Skip to content

Commit

Permalink
fix docker logger
Browse files Browse the repository at this point in the history
  • Loading branch information
luist18 committed Feb 23, 2025
1 parent cc9d0a8 commit d38f7d0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pumpkin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,20 @@ pub static LOGGER_IMPL: LazyLock<Option<(ReadlineLogWrapper, LevelFilter)>> = La
.unwrap_or(LevelFilter::Info);

if ADVANCED_CONFIG.commands.use_console {
let (rl, stdout) = Readline::new("$ ".to_owned()).unwrap();
let logger = simplelog::WriteLogger::new(level, config.build(), stdout);
Some((ReadlineLogWrapper::new(logger, Some(rl)), level))
match Readline::new("$ ".to_owned()) {
Ok((rl, stdout)) => {
let logger = simplelog::WriteLogger::new(level, config.build(), stdout);
Some((ReadlineLogWrapper::new(logger, Some(rl)), level))
}
Err(e) => {
log::warn!(
"Failed to initialize console input ({}), falling back to simple logger",
e
);
let logger = simplelog::SimpleLogger::new(level, config.build());
Some((ReadlineLogWrapper::new(logger, None), level))
}
}
} else {
let logger = simplelog::SimpleLogger::new(level, config.build());
Some((ReadlineLogWrapper::new(logger, None), level))
Expand Down

0 comments on commit d38f7d0

Please sign in to comment.