update obs

This commit is contained in:
weisd
2025-06-06 16:46:12 +08:00
parent f199718e3b
commit 7032318858
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ tracing-error = { workspace = true }
tracing-opentelemetry = { workspace = true }
tracing-subscriber = { workspace = true, features = ["registry", "std", "fmt", "env-filter", "tracing-log", "time", "local-time", "json"] }
tokio = { workspace = true, features = ["sync", "fs", "rt-multi-thread", "rt", "time", "macros"] }
reqwest = { workspace = true, optional = true, default-features = false }
reqwest = { workspace = true, optional = true }
serde_json = { workspace = true }
sysinfo = { workspace = true }
thiserror = { workspace = true }
+10 -1
View File
@@ -329,7 +329,16 @@ pub(crate) fn init_telemetry(config: &OtelConfig) -> OtelGuard {
};
// Configure the flexi_logger
let flexi_logger_result = flexi_logger::Logger::with(log_spec)
let flexi_logger_result = flexi_logger::Logger::try_with_env_or_str(logger_level)
.unwrap_or_else(|e| {
eprintln!(
"Invalid logger level: {}, using default: {},failed error:{}",
logger_level,
DEFAULT_LOG_LEVEL,
e.to_string()
);
flexi_logger::Logger::with(log_spec.clone())
})
.log_to_file(
FileSpec::default()
.directory(log_directory)