diff --git a/.github/workflows/after-pub.yml b/.github/workflows/after-pub.yml index 58f3c14..52f3e09 100644 --- a/.github/workflows/after-pub.yml +++ b/.github/workflows/after-pub.yml @@ -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()); diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 3920cb8..3f5242a 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -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 }} diff --git a/Cargo.lock b/Cargo.lock index b2e2716..dfff63b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,9 +16,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.7.3" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" [[package]] name = "bitflags" @@ -34,9 +34,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.24" +version = "1.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16595d3be041c03b09d08d0858631facccee9221e579704070e6e9e4915d3bc7" +checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951" dependencies = [ "shlex", ] @@ -404,7 +404,7 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "logdash" -version = "1.0.0" +version = "1.0.1" dependencies = [ "owo-colors", "serde", @@ -459,9 +459,9 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" -version = "0.10.72" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ "bitflags", "cfg-if", @@ -491,9 +491,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.108" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 9fbcb21..1ac7ffe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "logdash" -version = "1.0.0" +version = "1.0.1" edition = "2024" license = "MIT" authors = ["firesz25 "] @@ -8,6 +8,8 @@ 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" } diff --git a/examples/client_fron_env.rs b/examples/client_fron_env.rs index ae28428..662defb 100644 --- a/examples/client_fron_env.rs +++ b/examples/client_fron_env.rs @@ -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); diff --git a/src/log.rs b/src/log.rs index cc25c5c..9d536c2 100644 --- a/src/log.rs +++ b/src/log.rs @@ -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), @@ -97,7 +97,7 @@ pub struct LogMessage { #[serde(rename_all = "camelCase")] pub enum LogLevel { Error, - Warn, + Warning, Info, Http, Verbose, @@ -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"), diff --git a/src/propagator/terminal.rs b/src/propagator/terminal.rs index fc16a77..e840cf4 100644 --- a/src/propagator/terminal.rs +++ b/src/propagator/terminal.rs @@ -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 )