tracing level

This commit is contained in:
asxalex 2024-03-01 15:29:16 +08:00
parent 0078de5ffe
commit 5630f12e51
3 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@ fn do_log() {
debug!("debug");
}
fn criterion_benchmark(c: &mut Criterion) {
let _guard = default(false, false);
let _guard = default(false, false, tracing::Level::DEBUG);
c.bench_function("log", |b| b.iter(|| do_log()));
}

View File

@ -2,6 +2,6 @@ use rolling_file::default;
mod submod;
fn main() {
let _guard = default(false, false);
let _guard = default(false, false, tracing::Level::DEBUG);
submod::do_record();
}

View File

@ -245,12 +245,13 @@ pub fn new_log<P: AsRef<Path>>(
pub fn default(
with_filename: bool,
with_line_number: bool,
level: tracing::Level,
) -> tracing_appender::non_blocking::WorkerGuard {
new_log(
"./.output",
7,
PeriodGap::Daily,
tracing::Level::DEBUG,
level,
with_filename,
with_line_number,
)