Skip to content

Commit 99cf03a

Browse files
Merge pull request #4 from logdash-io/dev
fix: change warning log level
2 parents bc47960 + e3c0686 commit 99cf03a

7 files changed

Lines changed: 48 additions & 40 deletions

File tree

.github/workflows/after-pub.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
cargo new temp-test
3333
cd temp-test
3434
cargo add logdash
35-
echo 'fn main() { rs   18:39
35+
echo 'fn main() {
3636
// Create a new Logdash client with default configuration
3737
let (l, m) = logdash::create_logdash(logdash::Config::default());
3838

.github/workflows/release-plz.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ jobs:
3232
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3333

3434
# Create a PR with the new versions and changelog, preparing the next release.
35-
release-plz-pr:
36-
name: Release-plz PR
37-
runs-on: ubuntu-latest
38-
permissions:
39-
contents: write
40-
pull-requests: write
41-
concurrency:
42-
group: release-plz-${{ github.ref }}
43-
cancel-in-progress: false
44-
steps:
45-
- name: Checkout repository
46-
uses: actions/checkout@v4
47-
with:
48-
fetch-depth: 0
49-
- name: Install Rust toolchain
50-
uses: dtolnay/rust-toolchain@stable
51-
- name: Run release-plz
52-
uses: release-plz/action@v0.5
53-
with:
54-
command: release-pr
55-
config: release-plz.toml
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35+
# release-plz-pr:
36+
# name: Release-plz PR
37+
# runs-on: ubuntu-latest
38+
# permissions:
39+
# contents: write
40+
# pull-requests: write
41+
# concurrency:
42+
# group: release-plz-${{ github.ref }}
43+
# cancel-in-progress: false
44+
# steps:
45+
# - name: Checkout repository
46+
# uses: actions/checkout@v4
47+
# with:
48+
# fetch-depth: 0
49+
# - name: Install Rust toolchain
50+
# uses: dtolnay/rust-toolchain@stable
51+
# - name: Run release-plz
52+
# uses: release-plz/action@v0.5
53+
# with:
54+
# command: release-pr
55+
# config: release-plz.toml
56+
# env:
57+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
[package]
22
name = "logdash"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2024"
55
license = "MIT"
66
authors = ["firesz25 <olek.cz@outlook.com>"]
77
readme = "README.md"
88
repository = "https://github.com/logdash-io/rust-sdk"
99
homepage = "https://github.com/logdash-io/rust-sdk"
1010
description = "Logdash.io simple client"
11+
categories = ["API-bindings"]
12+
keywords = ["api", "sdk", "metrics", "logging", "logdash"]
1113

1214
[dependencies]
1315
owo-colors = { version = "4.2.1" }

examples/client_fron_env.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ fn main() {
44

55
// Send an info log message
66
l.info("Rust SDK example");
7+
l.warn("elo");
8+
l.error("elo");
9+
l.debug("elo");
10+
l.silly("elo");
11+
l.http("elo");
12+
l.verbose("elo");
713

814
// Send a metric message
915
m.set("user".into(), 0.0);

src/log.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl LogCollector {
3030

3131
pub fn warn(&self, message: impl IntoLog) {
3232
self.send(LogMessage {
33-
level: LogLevel::Warn,
33+
level: LogLevel::Warning,
3434
message: message.into_log(),
3535
created_at: OffsetDateTime::now_utc(),
3636
sequence_number: self.sequence_number.fetch_add(1, Ordering::SeqCst),
@@ -97,7 +97,7 @@ pub struct LogMessage {
9797
#[serde(rename_all = "camelCase")]
9898
pub enum LogLevel {
9999
Error,
100-
Warn,
100+
Warning,
101101
Info,
102102
Http,
103103
Verbose,
@@ -109,7 +109,7 @@ impl fmt::Display for LogLevel {
109109
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
110110
match self {
111111
LogLevel::Error => write!(f, "error"),
112-
LogLevel::Warn => write!(f, "warn"),
112+
LogLevel::Warning => write!(f, "warning"),
113113
LogLevel::Info => write!(f, "info"),
114114
LogLevel::Http => write!(f, "http"),
115115
LogLevel::Verbose => write!(f, "verbose"),

src/propagator/terminal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ impl WorkerJob for TerminalPropagator {
2727
log.message
2828
)
2929
}
30-
crate::log::LogLevel::Warn => {
30+
crate::log::LogLevel::Warning => {
3131
println!(
3232
"{} [{}] {}",
33-
"Warn:".truecolor(254, 154, 0),
33+
"Warning:".truecolor(254, 154, 0),
3434
log.created_at,
3535
log.message
3636
)

0 commit comments

Comments
 (0)