pub fn try_init() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
tracing_subscriber::fmt()
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("warn")),
)
.with_target(true)
.with_thread_ids(false)
.with_file(false)
.with_line_number(false)
.try_init()
}
pub fn try_init_dev() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
tracing_subscriber::fmt()
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("debug")),
)
.with_target(true)
.with_thread_ids(false)
.with_file(true)
.with_line_number(true)
.compact()
.try_init()
}