mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
Avoid stdout and panic logging when TUI is running (#1837)
This commit is contained in:
parent
038e21859a
commit
0959bf376c
1 changed files with 7 additions and 1 deletions
|
@ -74,6 +74,12 @@ impl Filter for GrinFilter {
|
|||
/// Initialize the logger with the given configuration
|
||||
pub fn init_logger(config: Option<LoggingConfig>) {
|
||||
if let Some(c) = config {
|
||||
let tui_running = c.tui_running.unwrap_or(false);
|
||||
if tui_running {
|
||||
let mut tui_running_ref = TUI_RUNNING.lock();
|
||||
*tui_running_ref = true;
|
||||
}
|
||||
|
||||
// Save current logging configuration
|
||||
let mut config_ref = LOGGING_CONFIG.lock();
|
||||
*config_ref = c.clone();
|
||||
|
@ -98,7 +104,7 @@ pub fn init_logger(config: Option<LoggingConfig>) {
|
|||
|
||||
let mut appenders = vec![];
|
||||
|
||||
if c.log_to_stdout {
|
||||
if c.log_to_stdout && !tui_running {
|
||||
let filter = Box::new(ThresholdFilter::new(level_stdout));
|
||||
appenders.push(
|
||||
Appender::builder()
|
||||
|
|
Loading…
Reference in a new issue