File tree Expand file tree Collapse file tree 3 files changed +20
-12
lines changed
catalyst-toolbox/src/bin/cli/recovery Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,18 @@ impl Recover {
1818 }
1919 }
2020}
21+
22+ fn set_verbosity ( verbosity : usize ) {
23+ if verbosity > 0 {
24+ std:: env:: set_var (
25+ "RUST_LOG" ,
26+ match verbosity {
27+ 0 => unreachable ! ( ) ,
28+ 1 => "warn" ,
29+ 2 => "info" ,
30+ 3 => "debug" ,
31+ _ => "trace" ,
32+ } ,
33+ )
34+ }
35+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ use std::path::PathBuf;
1414use reqwest:: Url ;
1515use structopt:: StructOpt ;
1616
17+ use super :: set_verbosity;
18+
1719#[ allow( clippy:: large_enum_variant) ]
1820#[ derive( thiserror:: Error , Debug ) ]
1921pub enum Error {
@@ -90,6 +92,8 @@ impl ReplayCli {
9092 verbose,
9193 } = self ;
9294
95+ set_verbosity ( verbose) ;
96+
9397 let block0 = if let Some ( path) = block0_path {
9498 read_block0 ( path) ?
9599 } else if let Some ( url) = block0_url {
Original file line number Diff line number Diff line change @@ -102,18 +102,7 @@ impl VotesPrintout {
102102 verbose,
103103 } = self ;
104104
105- if verbose > 0 {
106- std:: env:: set_var (
107- "RUST_LOG" ,
108- match verbose {
109- 0 => unreachable ! ( ) ,
110- 1 => "warn" ,
111- 2 => "info" ,
112- 3 => "debug" ,
113- _ => "trace" ,
114- } ,
115- )
116- }
105+ set_verbosity ( verbose) ;
117106
118107 let reader = std:: fs:: File :: open ( block0_path) ?;
119108 let block0 = Block :: deserialize ( & mut Codec :: new ( reader) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments