Common log init function
This commit is contained in:
@@ -13,24 +13,8 @@ pub enum ChainEra {
|
||||
Homestead,
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref LOG_DUMMY: bool = {
|
||||
let mut builder = LogBuilder::new();
|
||||
builder.filter(None, LogLevelFilter::Info);
|
||||
|
||||
if let Ok(log) = env::var("RUST_LOG") {
|
||||
builder.parse(&log);
|
||||
}
|
||||
|
||||
if let Ok(_) = builder.init() {
|
||||
println!("logger initialized");
|
||||
}
|
||||
true
|
||||
};
|
||||
}
|
||||
|
||||
pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
|
||||
let _ = LOG_DUMMY.deref();
|
||||
init_log();
|
||||
let json = Json::from_str(::std::str::from_utf8(json_data).unwrap()).expect("Json is invalid");
|
||||
let mut failed = Vec::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user