Skip to content

Commit

Permalink
Merge pull request #3784 from stacks-network/feat/ignore-logging-errors
Browse files Browse the repository at this point in the history
Feat: ignore logging errors rather than panicking
  • Loading branch information
kantai authored Jul 11, 2023
2 parents 183a043 + 3bd9f46 commit c8ebe3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stacks-common/src/util/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ fn make_json_logger() -> Logger {
}),
);

let drain = Mutex::new(slog_json::Json::default(std::io::stderr())).map(slog::Fuse);
let filtered_drain = slog::LevelFilter::new(drain, get_loglevel()).fuse();
let drain = Mutex::new(slog_json::Json::default(std::io::stderr()));
let filtered_drain = slog::LevelFilter::new(drain, get_loglevel()).ignore_res();
slog::Logger::root(filtered_drain, def_keys)
}

Expand All @@ -225,7 +225,7 @@ fn make_logger() -> Logger {
let decorator = slog_term::PlainSyncDecorator::new(std::io::stderr());
let atty = isatty(Stream::Stderr);
let drain = TermFormat::new(decorator, pretty_print, debug, atty);
let logger = Logger::root(drain.fuse(), o!());
let logger = Logger::root(drain.ignore_res(), o!());
logger
}
}
Expand All @@ -239,7 +239,7 @@ fn make_logger() -> Logger {
let plain = slog_term::PlainSyncDecorator::new(slog_term::TestStdoutWriter);
let isatty = isatty(Stream::Stdout);
let drain = TermFormat::new(plain, false, debug, isatty);
let logger = Logger::root(drain.fuse(), o!());
let logger = Logger::root(drain.ignore_res(), o!());
logger
}
}
Expand Down

0 comments on commit c8ebe3e

Please sign in to comment.