Replace ethcore-logger with env-logger. (#10102)

* Replace ethcore-logger with env-logger.

* Fix logger initialization in WASM tests.

* uncomment logger initialization in secret store

* Don't use ethcore-logger in whisper.

* Move ethcore-logger within parity dir.

* Uncomment rest from secret-store.

* Use `let _ =` in private_contract for consistency

* `ok()` to `let _ =` fix in service

* Use `let _ = ` for state_db
This commit is contained in:
Tomasz Drwięga
2019-01-08 15:07:20 +01:00
committed by Marek Kotewicz
parent ce5f704dd5
commit ab22d5e278
42 changed files with 128 additions and 143 deletions

View File

@@ -42,7 +42,7 @@ fn skip_test(name: &String) -> bool {
}
pub fn json_chain_test<H: FnMut(&str, HookType)>(json_data: &[u8], start_stop_hook: &mut H) -> Vec<String> {
::ethcore_logger::init_log();
let _ = ::env_logger::try_init();
let tests = ethjson::blockchain::Test::load(json_data).unwrap();
let mut failed = Vec::new();

View File

@@ -22,7 +22,7 @@ use spec::Spec;
use super::HookType;
pub fn json_difficulty_test<H: FnMut(&str, HookType)>(json_data: &[u8], spec: Spec, start_stop_hook: &mut H) -> Vec<String> {
::ethcore_logger::init_log();
let _ = ::env_logger::try_init();
let tests = ethjson::test::DifficultyTest::load(json_data).unwrap();
let engine = &spec.engine;

View File

@@ -48,7 +48,7 @@ fn skip_test(subname: &str, chain: &String, number: usize) -> bool {
}
pub fn json_chain_test<H: FnMut(&str, HookType)>(json_data: &[u8], start_stop_hook: &mut H) -> Vec<String> {
::ethcore_logger::init_log();
let _ = ::env_logger::try_init();
let tests = ethjson::state::test::Test::load(json_data).unwrap();
let mut failed = Vec::new();

View File

@@ -108,13 +108,11 @@ extern crate wasm;
#[cfg(feature = "stratum")]
extern crate ethcore_stratum;
#[cfg(any(test, feature = "json-tests", feature = "test-helpers"))]
#[cfg(any(test, feature = "tempdir"))]
extern crate tempdir;
#[cfg(any(test, feature = "json-tests"))]
extern crate ethcore_logger;
#[cfg(any(test, feature = "test-helpers"))]
#[cfg(any(test, feature = "kvdb-rocksdb"))]
extern crate kvdb_rocksdb;
#[cfg(any(test, feature = "test-helpers"))]
#[cfg(any(test, feature = "blooms-db"))]
extern crate blooms_db;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows", target_os = "android"))]
@@ -145,7 +143,7 @@ extern crate serde_derive;
#[cfg_attr(test, macro_use)]
extern crate evm;
#[cfg(test)]
#[cfg(any(test, feature = "env_logger"))]
extern crate env_logger;
#[cfg(test)]
extern crate rlp_compress;

View File

@@ -36,8 +36,7 @@ use verification::queue::kind::blocks::Unverified;
#[test]
fn restored_is_equivalent() {
use ::ethcore_logger::init_log;
init_log();
let _ = ::env_logger::try_init();
const NUM_BLOCKS: u32 = 400;
const TX_PER: usize = 5;
@@ -152,7 +151,7 @@ fn guards_delete_folders() {
#[test]
fn keep_ancient_blocks() {
::env_logger::try_init().ok();
let _ = ::env_logger::try_init();
// Test variables
const NUM_BLOCKS: u64 = 500;
@@ -271,7 +270,7 @@ fn keep_ancient_blocks() {
#[test]
fn recover_aborted_recovery() {
::env_logger::try_init().ok();
let _ = ::env_logger::try_init();
const NUM_BLOCKS: u32 = 400;
let gas_prices = vec![1.into(), 2.into(), 3.into(), 999.into()];

View File

@@ -1018,7 +1018,7 @@ mod tests {
#[test]
fn genesis_constructor() {
::ethcore_logger::init_log();
let _ = ::env_logger::try_init();
let spec = Spec::new_test_constructor();
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default())
.unwrap();

View File

@@ -1316,7 +1316,6 @@ mod tests {
use vm::EnvInfo;
use spec::*;
use types::transaction::*;
use ethcore_logger::init_log;
use trace::{FlatTrace, TraceError, trace};
use evm::CallType;
@@ -1332,7 +1331,7 @@ mod tests {
#[test]
fn should_apply_create_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1372,7 +1371,7 @@ mod tests {
#[test]
fn should_work_when_cloned() {
init_log();
let _ = env_logger::try_init();
let a = Address::zero();
@@ -1390,7 +1389,7 @@ mod tests {
#[test]
fn should_trace_failed_create_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1426,7 +1425,7 @@ mod tests {
#[test]
fn should_trace_call_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1468,7 +1467,7 @@ mod tests {
#[test]
fn should_trace_basic_call_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1509,7 +1508,7 @@ mod tests {
#[test]
fn should_trace_call_transaction_to_builtin() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1550,7 +1549,7 @@ mod tests {
#[test]
fn should_not_trace_subcall_transaction_to_builtin() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1592,7 +1591,7 @@ mod tests {
#[test]
fn should_trace_callcode_properly() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1650,7 +1649,7 @@ mod tests {
#[test]
fn should_trace_delegatecall_properly() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1709,7 +1708,7 @@ mod tests {
#[test]
fn should_trace_failed_call_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1748,7 +1747,7 @@ mod tests {
#[test]
fn should_trace_call_with_subcall_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1807,7 +1806,7 @@ mod tests {
#[test]
fn should_trace_call_with_basic_subcall_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1861,7 +1860,7 @@ mod tests {
#[test]
fn should_not_trace_call_with_invalid_basic_subcall_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1903,7 +1902,7 @@ mod tests {
#[test]
fn should_trace_failed_subcall_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -1958,7 +1957,7 @@ mod tests {
#[test]
fn should_trace_call_with_subcall_with_subcall_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -2032,7 +2031,7 @@ mod tests {
#[test]
fn should_trace_failed_subcall_with_subcall_transaction() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();
@@ -2104,7 +2103,7 @@ mod tests {
#[test]
fn should_trace_suicide() {
init_log();
let _ = env_logger::try_init();
let mut state = get_temp_state();

View File

@@ -483,11 +483,10 @@ mod tests {
use kvdb::DBTransaction;
use test_helpers::get_temp_state_db;
use state::{Account, Backend};
use ethcore_logger::init_log;
#[test]
fn state_db_smoke() {
init_log();
let _ = ::env_logger::try_init();
let state_db = get_temp_state_db();
let root_parent = H256::random();