Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/after-pub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cargo new temp-test
cd temp-test
cargo add logdash
echo 'fn main() { rs   18:39
echo 'fn main() {
// Create a new Logdash client with default configuration
let (l, m) = logdash::create_logdash(logdash::Config::default());

Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release-pr
config: release-plz.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# release-plz-pr:
# name: Release-plz PR
# runs-on: ubuntu-latest
# permissions:
# contents: write
# pull-requests: write
# concurrency:
# group: release-plz-${{ github.ref }}
# cancel-in-progress: false
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# - name: Run release-plz
# uses: release-plz/action@v0.5
# with:
# command: release-pr
# config: release-plz.toml
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[package]
name = "logdash"
version = "1.0.0"
version = "1.0.1"
edition = "2024"
license = "MIT"
authors = ["firesz25 <olek.cz@outlook.com>"]
readme = "README.md"
repository = "https://github.com/logdash-io/rust-sdk"
homepage = "https://github.com/logdash-io/rust-sdk"
description = "Logdash.io simple client"
categories = ["API-bindings"]
keywords = ["api", "sdk", "metrics", "logging", "logdash"]

[dependencies]
owo-colors = { version = "4.2.1" }
Expand Down
6 changes: 6 additions & 0 deletions examples/client_fron_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ fn main() {

// Send an info log message
l.info("Rust SDK example");
l.warn("elo");
l.error("elo");
l.debug("elo");
l.silly("elo");
l.http("elo");
l.verbose("elo");

// Send a metric message
m.set("user".into(), 0.0);
Expand Down
6 changes: 3 additions & 3 deletions src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl LogCollector {

pub fn warn(&self, message: impl IntoLog) {
self.send(LogMessage {
level: LogLevel::Warn,
level: LogLevel::Warning,
message: message.into_log(),
created_at: OffsetDateTime::now_utc(),
sequence_number: self.sequence_number.fetch_add(1, Ordering::SeqCst),
Expand Down Expand Up @@ -97,7 +97,7 @@ pub struct LogMessage {
#[serde(rename_all = "camelCase")]
pub enum LogLevel {
Error,
Warn,
Warning,
Info,
Http,
Verbose,
Expand All @@ -109,7 +109,7 @@ impl fmt::Display for LogLevel {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
LogLevel::Error => write!(f, "error"),
LogLevel::Warn => write!(f, "warn"),
LogLevel::Warning => write!(f, "warning"),
LogLevel::Info => write!(f, "info"),
LogLevel::Http => write!(f, "http"),
LogLevel::Verbose => write!(f, "verbose"),
Expand Down
4 changes: 2 additions & 2 deletions src/propagator/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ impl WorkerJob for TerminalPropagator {
log.message
)
}
crate::log::LogLevel::Warn => {
crate::log::LogLevel::Warning => {
println!(
"{} [{}] {}",
"Warn:".truecolor(254, 154, 0),
"Warning:".truecolor(254, 154, 0),
log.created_at,
log.message
)
Expand Down