Skip to content

Commit 34703d7

Browse files
kantaiwileyj
authored andcommitted
feat: ignore logging errors rather than panicking
1 parent 11e6439 commit 34703d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stacks-common/src/util/log.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ fn make_json_logger() -> Logger {
205205
}),
206206
);
207207

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

@@ -225,7 +225,7 @@ fn make_logger() -> Logger {
225225
let decorator = slog_term::PlainSyncDecorator::new(std::io::stderr());
226226
let atty = isatty(Stream::Stderr);
227227
let drain = TermFormat::new(decorator, pretty_print, debug, atty);
228-
let logger = Logger::root(drain.fuse(), o!());
228+
let logger = Logger::root(drain.ignore_res(), o!());
229229
logger
230230
}
231231
}
@@ -239,7 +239,7 @@ fn make_logger() -> Logger {
239239
let plain = slog_term::PlainSyncDecorator::new(slog_term::TestStdoutWriter);
240240
let isatty = isatty(Stream::Stdout);
241241
let drain = TermFormat::new(plain, false, debug, isatty);
242-
let logger = Logger::root(drain.fuse(), o!());
242+
let logger = Logger::root(drain.ignore_res(), o!());
243243
logger
244244
}
245245
}

0 commit comments

Comments
 (0)