use tracing::level_filters::LevelFilter;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use tracing_subscriber::{fmt, EnvFilter, Layer};
pub fn init_logger() {
let enable_color = if cfg!(windows) {
false
} else {
supports_color::on(supports_color::Stream::Stderr).is_some()
};
tracing_subscriber::registry()
.with(
fmt::layer().with_ansi(enable_color).with_filter(
EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy(),
),
)
.init();
}