Skip to content

Commit

Permalink
add static init log features
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed Aug 22, 2023
1 parent 96624ae commit 1e889dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "simple-log"
version = "1.6.0"
version = "1.7.0"
authors = ["baoyachi <liaoymxsdl@gmail.com>"]
description = "A simple log. It's really simple use"
edition = "2018"
Expand All @@ -20,6 +20,10 @@ once_cell = "1.15.0"
serde = { version = "1.0.145", features = ["derive"] }
is_debug = "1.0.1"
convert_case = "0.6.0"
ctor = { version = "0.2.2", optional = true }

[features]
debug = ["ctor"]

[dev-dependencies]
serde_json = "1"
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,9 @@ pub mod log_level {
}
}
}

#[cfg(feature = "debug")]
#[ctor::ctor]
fn init_log() {
quick!();
}

0 comments on commit 1e889dd

Please sign in to comment.