mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-01-09 17:29:10 +00:00
feat: remove verbosity from release mode logs
Some checks failed
Debug / Get build version (push) Has been cancelled
Test & Lint / lint (push) Has been cancelled
Debug / Build for linux-x86_64 (push) Has been cancelled
Debug / Build for macos-aarch64 (push) Has been cancelled
Debug / Build for macos-x86_64 (push) Has been cancelled
Debug / Build for windows-x86_64 (push) Has been cancelled
Some checks failed
Debug / Get build version (push) Has been cancelled
Test & Lint / lint (push) Has been cancelled
Debug / Build for linux-x86_64 (push) Has been cancelled
Debug / Build for macos-aarch64 (push) Has been cancelled
Debug / Build for macos-x86_64 (push) Has been cancelled
Debug / Build for windows-x86_64 (push) Has been cancelled
This commit is contained in:
parent
3569ff32cd
commit
f009c957ca
1 changed files with 16 additions and 8 deletions
24
src/main.rs
24
src/main.rs
|
@ -13,8 +13,7 @@ use tempfile::NamedTempFile;
|
|||
use tracing::instrument;
|
||||
use tracing_indicatif::{filter::IndicatifFilter, IndicatifLayer};
|
||||
use tracing_subscriber::{
|
||||
filter::LevelFilter, fmt::time::uptime, layer::SubscriberExt, util::SubscriberInitExt,
|
||||
EnvFilter, Layer,
|
||||
filter::LevelFilter, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer,
|
||||
};
|
||||
|
||||
mod cli;
|
||||
|
@ -147,14 +146,23 @@ async fn run() -> anyhow::Result<()> {
|
|||
.add_directive("hyper=info".parse().unwrap())
|
||||
.add_directive("h2=info".parse().unwrap());
|
||||
|
||||
let fmt_layer =
|
||||
tracing_subscriber::fmt::layer().with_writer(indicatif_layer.inner().get_stderr_writer());
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
let fmt_layer = fmt_layer.with_timer(tracing_subscriber::fmt::time::uptime());
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
let fmt_layer = fmt_layer
|
||||
.pretty()
|
||||
.with_timer(())
|
||||
.with_line_number(false)
|
||||
.with_file(false)
|
||||
.with_target(false);
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(tracing_env_filter)
|
||||
.with(
|
||||
tracing_subscriber::fmt::layer()
|
||||
.pretty()
|
||||
.with_writer(indicatif_layer.inner().get_stderr_writer())
|
||||
.with_timer(uptime()),
|
||||
)
|
||||
.with(fmt_layer)
|
||||
.with(indicatif_layer)
|
||||
.init();
|
||||
|
||||
|
|
Loading…
Reference in a new issue