Skip to content

Commit

Permalink
Fix dropped log guard and so missing logging (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
boxdot authored Dec 1, 2022
1 parent 3966015 commit 022f66c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ struct Args {
async fn main() -> anyhow::Result<()> {
let args = Args::parse();

if args.verbosity > 0 {
let _guard = if args.verbosity > 0 {
let file_appender = tracing_appender::rolling::never("./", "gurk.log");
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
let (non_blocking, guard) = tracing_appender::non_blocking(file_appender);
tracing_subscriber::fmt()
.with_max_level(match args.verbosity {
0 => LevelFilter::OFF,
Expand All @@ -61,7 +61,10 @@ async fn main() -> anyhow::Result<()> {
.with_writer(non_blocking)
.with_ansi(false)
.init();
}
Some(guard)
} else {
None
};

log_panics::init();

Expand Down

0 comments on commit 022f66c

Please sign in to comment.