mirror of
https://github.com/OMGeeky/twba.common.git
synced 2025-12-26 17:02:35 +01:00
allow - in init_tracing inside crate name
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "twba-common"
|
||||
version = "0.2.5"
|
||||
version = "0.2.6"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -19,9 +19,10 @@ pub fn get_config() -> Conf {
|
||||
}
|
||||
|
||||
pub fn init_tracing(crate_name: &str) -> Vec<WorkerGuard> {
|
||||
let (guard1, warn_file) = file_tracer(crate_name, Level::WARN, Rotation::DAILY);
|
||||
let (guard2, info_file) = file_tracer(crate_name, Level::INFO, Rotation::DAILY);
|
||||
let (guard3, trace_file) = file_tracer(crate_name, Level::TRACE, Rotation::DAILY);
|
||||
let crate_name = crate_name.replace('-', "_");
|
||||
let (guard1, warn_file) = file_tracer(&crate_name, Level::WARN, Rotation::DAILY);
|
||||
let (guard2, info_file) = file_tracer(&crate_name, Level::INFO, Rotation::DAILY);
|
||||
let (guard3, trace_file) = file_tracer(&crate_name, Level::TRACE, Rotation::DAILY);
|
||||
|
||||
let file_subscriber = Subscriber::builder()
|
||||
.with_env_filter(format!("warn,{}=trace", crate_name))
|
||||
|
||||
Reference in New Issue
Block a user