mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 13:01:12 +03:00
logger env
This commit is contained in:
parent
84979849eb
commit
c53c10cb0a
1 changed files with 6 additions and 1 deletions
|
|
@ -102,11 +102,16 @@ async fn health_check() -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const LOGGER_ENV: &str = "RUST_LOG";
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
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()
|
tracing_subscriber::fmt::fmt()
|
||||||
.with_env_filter(
|
.with_env_filter(
|
||||||
"trace,axum=info,tower_http=info,tokio=info,tungstenite=info,tokio_tungstenite=info",
|
logger_env
|
||||||
)
|
)
|
||||||
.pretty()
|
.pretty()
|
||||||
.init();
|
.init();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue