瀏覽代碼

bin/fud/fu: change logging function and use ColorChoice from termcolor

oars 1 年之前
父節點
當前提交
83fe73480b
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      bin/fud/fu/src/main.rs

+ 3 - 5
bin/fud/fu/src/main.rs

@@ -23,7 +23,7 @@ use std::{
     io::{stdout, Write},
     io::{stdout, Write},
     sync::Arc,
     sync::Arc,
 };
 };
-use termcolor::{StandardStream, WriteColor};
+use termcolor::{ColorChoice, StandardStream, WriteColor};
 use tracing::error;
 use tracing::error;
 use url::Url;
 use url::Url;
 
 
@@ -35,7 +35,7 @@ use darkfi::{
         util::JsonValue,
         util::JsonValue,
     },
     },
     system::{ExecutorPtr, Publisher, StoppableTask},
     system::{ExecutorPtr, Publisher, StoppableTask},
-    util::cli::{get_log_config, get_log_level},
+    util::logger::setup_logging,
     Error, Result,
     Error, Result,
 };
 };
 
 
@@ -787,9 +787,7 @@ impl Fu {
 fn main() -> Result<()> {
 fn main() -> Result<()> {
     let args = Args::parse();
     let args = Args::parse();
 
 
-    let log_level = get_log_level(args.verbose);
-    let log_config = get_log_config(args.verbose);
-    TermLogger::init(log_level, log_config, TerminalMode::Mixed, ColorChoice::Auto)?;
+    setup_logging(args.verbose, None)?;
 
 
     let ex = Arc::new(smol::Executor::new());
     let ex = Arc::new(smol::Executor::new());
     smol::block_on(async {
     smol::block_on(async {