feat(dtmm): Improve logging output format
This commit is contained in:
parent
16bfe88101
commit
8b2ca0e45a
1 changed files with 21 additions and 8 deletions
|
@ -21,10 +21,22 @@ async fn main() -> Result<()> {
|
|||
let _matches = command!().get_matches();
|
||||
|
||||
{
|
||||
let fmt_layer = tracing_subscriber::fmt::layer().pretty();
|
||||
let filter_layer =
|
||||
EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?;
|
||||
|
||||
if cfg!(debug_assertions) {
|
||||
let fmt_layer = tracing_subscriber::fmt::layer().pretty();
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(filter_layer)
|
||||
.with(fmt_layer)
|
||||
.with(ErrorLayer::new(
|
||||
tracing_subscriber::fmt::format::Pretty::default(),
|
||||
))
|
||||
.init();
|
||||
} else {
|
||||
let fmt_layer = tracing_subscriber::fmt::layer().compact();
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(filter_layer)
|
||||
.with(fmt_layer)
|
||||
|
@ -33,6 +45,7 @@ async fn main() -> Result<()> {
|
|||
))
|
||||
.init();
|
||||
}
|
||||
}
|
||||
|
||||
let initial_state = State::new();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue