From 84e46c2872629ff0447884a6201a738070bcbbbd Mon Sep 17 00:00:00 2001 From: hashmap <hashmap@gmail.com> Date: Tue, 31 Jul 2018 12:14:13 +0200 Subject: [PATCH] Fix logging configuration (#1303) One of the last commits introduced a regression, logging function was called before log subsystem was initialized, as result all logging configuration was not applied. --- src/bin/grin.rs | 20 ++++++++++---------- src/bin/tui/ui.rs | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bin/grin.rs b/src/bin/grin.rs index 914b54e16..f05917e1e 100644 --- a/src/bin/grin.rs +++ b/src/bin/grin.rs @@ -333,16 +333,6 @@ fn main() { panic!("Error parsing config file: {}", e); }); - if let Some(file_path) = &global_config.config_file_path { - info!( - LOGGER, - "Found configuration file at {}", - file_path.to_str().unwrap() - ); - } else { - info!(LOGGER, "configuration file not found, using default"); - } - // initialize the logger let mut log_conf = global_config .members @@ -369,6 +359,16 @@ fn main() { log_build_info(); + if let Some(file_path) = &global_config.config_file_path { + info!( + LOGGER, + "Found configuration file at {}", + file_path.to_str().unwrap() + ); + } else { + info!(LOGGER, "configuration file not found, using default"); + } + match args.subcommand() { // server commands and options ("server", Some(server_args)) => { diff --git a/src/bin/tui/ui.rs b/src/bin/tui/ui.rs index e4d6b79ed..0001f32c1 100644 --- a/src/bin/tui/ui.rs +++ b/src/bin/tui/ui.rs @@ -15,9 +15,9 @@ //! Basic TUI to better output the overall system status and status //! of various subsystems +use chrono::prelude::Utc; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{mpsc, Arc}; -use chrono::prelude::{Utc}; use cursive::direction::Orientation; use cursive::theme::BaseColor::{Black, Blue, Cyan, White};