allow - in init_tracing inside crate name

This commit is contained in:
OMGeeky
2024-06-04 20:37:59 +02:00
parent c30028c8ac
commit 066665717f
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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))