logger env

This commit is contained in:
Cappy Ishihara 2024-06-03 01:19:16 +07:00
parent 84979849eb
commit c53c10cb0a
No known key found for this signature in database
GPG key ID: 50862C285CB76906

View file

@ -102,11 +102,16 @@ async fn health_check() -> String {
}
const LOGGER_ENV: &str = "RUST_LOG";
#[tokio::main]
async fn main() -> Result<()> {
// "trace,axum=info,tower_http=info,tokio=info,tungstenite=info,tokio_tungstenite=info",
let logger_env = std::env::var(LOGGER_ENV).unwrap_or_else(|_| "info".into());
tracing_subscriber::fmt::fmt()
.with_env_filter(
"trace,axum=info,tower_http=info,tokio=info,tungstenite=info,tokio_tungstenite=info",
logger_env
)
.pretty()
.init();