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

17
Cargo.lock generated
View File

@ -697,7 +697,6 @@ dependencies = [
"ethcore-bloom-journal 0.1.0", "ethcore-bloom-journal 0.1.0",
"ethcore-db 0.1.0", "ethcore-db 0.1.0",
"ethcore-io 1.12.0", "ethcore-io 1.12.0",
"ethcore-logger 1.12.0",
"ethcore-miner 1.12.0", "ethcore-miner 1.12.0",
"ethcore-stratum 1.12.0", "ethcore-stratum 1.12.0",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -923,9 +922,9 @@ dependencies = [
"ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
"assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-io 1.12.0", "ethcore-io 1.12.0",
"ethcore-logger 1.12.0",
"ethcore-network 1.12.0", "ethcore-network 1.12.0",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethkey 0.3.0", "ethkey 0.3.0",
@ -957,13 +956,13 @@ name = "ethcore-private-tx"
version = "1.0.0" version = "1.0.0"
dependencies = [ dependencies = [
"common-types 0.1.0", "common-types 0.1.0",
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.12.0", "ethcore 1.12.0",
"ethcore-io 1.12.0", "ethcore-io 1.12.0",
"ethcore-logger 1.12.0",
"ethcore-miner 1.12.0", "ethcore-miner 1.12.0",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethjson 0.1.0", "ethjson 0.1.0",
@ -996,11 +995,11 @@ version = "1.0.0"
dependencies = [ dependencies = [
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"common-types 0.1.0", "common-types 0.1.0",
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-contract 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi-derive 6.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.12.0", "ethcore 1.12.0",
"ethcore-logger 1.12.0",
"ethcore-sync 1.12.0", "ethcore-sync 1.12.0",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethkey 0.3.0", "ethkey 0.3.0",
@ -1052,7 +1051,6 @@ name = "ethcore-stratum"
version = "1.12.0" version = "1.12.0"
dependencies = [ dependencies = [
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-logger 1.12.0",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)",
"jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "jsonrpc-macros 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)",
@ -1729,7 +1727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "journaldb" name = "journaldb"
version = "0.2.0" version = "0.2.0"
dependencies = [ dependencies = [
"ethcore-logger 1.12.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fastmap 0.1.0", "fastmap 0.1.0",
"hashdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2386,7 +2384,6 @@ dependencies = [
"daemonize 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "daemonize 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dir 0.1.2", "dir 0.1.2",
"docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.12.0", "ethcore 1.12.0",
"ethcore-blockchain 0.1.0", "ethcore-blockchain 0.1.0",
"ethcore-db 0.1.0", "ethcore-db 0.1.0",
@ -2974,7 +2971,7 @@ name = "pwasm-run-test"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-logger 1.12.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethjson 0.1.0", "ethjson 0.1.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -4208,7 +4205,7 @@ name = "wasm"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-logger 1.12.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -4252,7 +4249,7 @@ name = "whisper-cli"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-logger 1.12.0", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-network 1.12.0", "ethcore-network 1.12.0",
"ethcore-network-devp2p 1.12.0", "ethcore-network-devp2p 1.12.0",
"jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-2.2)",

View File

@ -9,7 +9,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies] [dependencies]
blooms-db = { path = "util/blooms-db" } blooms-db = { path = "util/blooms-db" }
log = "0.4" log = "0.4"
env_logger = "0.5"
rustc-hex = "1.0" rustc-hex = "1.0"
docopt = "1.0" docopt = "1.0"
clap = "2" clap = "2"
@ -38,7 +37,7 @@ ethcore-blockchain = { path = "ethcore/blockchain" }
ethcore-db = { path = "ethcore/db" } ethcore-db = { path = "ethcore/db" }
ethcore-io = { path = "util/io" } ethcore-io = { path = "util/io" }
ethcore-light = { path = "ethcore/light" } ethcore-light = { path = "ethcore/light" }
ethcore-logger = { path = "logger" } ethcore-logger = { path = "parity/logger" }
ethcore-miner = { path = "miner" } ethcore-miner = { path = "miner" }
ethcore-network = { path = "util/network" } ethcore-network = { path = "util/network" }
ethcore-private-tx = { path = "ethcore/private-tx" } ethcore-private-tx = { path = "ethcore/private-tx" }

View File

@ -13,6 +13,7 @@ bn = { git = "https://github.com/paritytech/bn", default-features = false }
byteorder = "1.0" byteorder = "1.0"
common-types = { path = "types" } common-types = { path = "types" }
crossbeam = "0.4" crossbeam = "0.4"
env_logger = { version = "0.5", optional = true }
error-chain = { version = "0.12", default-features = false } error-chain = { version = "0.12", default-features = false }
ethabi = "6.0" ethabi = "6.0"
ethabi-contract = "6.0" ethabi-contract = "6.0"
@ -22,7 +23,6 @@ ethcore-blockchain = { path = "./blockchain" }
ethcore-bloom-journal = { path = "../util/bloom" } ethcore-bloom-journal = { path = "../util/bloom" }
ethcore-db = { path = "./db" } ethcore-db = { path = "./db" }
ethcore-io = { path = "../util/io" } ethcore-io = { path = "../util/io" }
ethcore-logger = { path = "../logger", optional = true }
ethcore-miner = { path = "../miner" } ethcore-miner = { path = "../miner" }
ethcore-stratum = { path = "../miner/stratum", optional = true } ethcore-stratum = { path = "../miner/stratum", optional = true }
ethereum-types = "0.4" ethereum-types = "0.4"
@ -81,7 +81,6 @@ fake-hardware-wallet = { path = "../accounts/fake-hardware-wallet" }
blooms-db = { path = "../util/blooms-db" } blooms-db = { path = "../util/blooms-db" }
criterion = "0.2" criterion = "0.2"
env_logger = "0.5" env_logger = "0.5"
ethcore-logger = { path = "../logger" }
kvdb-rocksdb = "0.1.3" kvdb-rocksdb = "0.1.3"
rlp_compress = { path = "../util/rlp-compress" } rlp_compress = { path = "../util/rlp-compress" }
tempdir = "0.3" tempdir = "0.3"
@ -109,7 +108,7 @@ evm-debug-tests = ["evm-debug", "evm/evm-debug-tests"]
# EVM debug traces are printed. # EVM debug traces are printed.
slow-blocks = [] slow-blocks = []
# Run JSON consensus tests. # Run JSON consensus tests.
json-tests = ["ethcore-logger", "test-helpers", "tempdir", "to-pod-full"] json-tests = ["env_logger", "test-helpers", "to-pod-full"]
# Skip JSON consensus tests with pending issues. # Skip JSON consensus tests with pending issues.
ci-skip-issue = [] ci-skip-issue = []
# Run memory/cpu heavy tests. # Run memory/cpu heavy tests.

View File

@ -13,7 +13,6 @@ ethabi-contract = "6.0"
ethabi-derive = "6.0" ethabi-derive = "6.0"
ethcore = { path = ".." } ethcore = { path = ".." }
ethcore-io = { path = "../../util/io" } ethcore-io = { path = "../../util/io" }
ethcore-logger = { path = "../../logger" }
ethcore-miner = { path = "../../miner" } ethcore-miner = { path = "../../miner" }
ethereum-types = "0.4" ethereum-types = "0.4"
ethjson = { path = "../../json" } ethjson = { path = "../../json" }
@ -40,4 +39,5 @@ transaction-pool = "1.13.2"
url = "1" url = "1"
[dev-dependencies] [dev-dependencies]
env_logger = "0.5"
ethcore = { path = "..", features = ["test-helpers"] } ethcore = { path = "..", features = ["test-helpers"] }

View File

@ -60,7 +60,7 @@ extern crate rlp_derive;
#[cfg(test)] #[cfg(test)]
extern crate rand; extern crate rand;
#[cfg(test)] #[cfg(test)]
extern crate ethcore_logger; extern crate env_logger;
pub use encryptor::{Encryptor, SecretStoreEncryptor, EncryptorConfig, NoopEncryptor}; pub use encryptor::{Encryptor, SecretStoreEncryptor, EncryptorConfig, NoopEncryptor};
pub use private_transactions::{VerifiedPrivateTransaction, VerificationStore, PrivateTransactionSigningDesc, SigningStore}; pub use private_transactions::{VerifiedPrivateTransaction, VerificationStore, PrivateTransactionSigningDesc, SigningStore};

View File

@ -17,9 +17,9 @@
//! Contract for private transactions tests. //! Contract for private transactions tests.
extern crate common_types as types; extern crate common_types as types;
extern crate env_logger;
extern crate ethcore; extern crate ethcore;
extern crate ethcore_io; extern crate ethcore_io;
extern crate ethcore_logger;
extern crate ethcore_private_tx; extern crate ethcore_private_tx;
extern crate ethkey; extern crate ethkey;
extern crate keccak_hash as hash; extern crate keccak_hash as hash;
@ -47,7 +47,7 @@ use ethcore_private_tx::{NoopEncryptor, Provider, ProviderConfig};
#[test] #[test]
fn private_contract() { fn private_contract() {
// This uses a simple private contract: contract Test1 { bytes32 public x; function setX(bytes32 _x) { x = _x; } } // This uses a simple private contract: contract Test1 { bytes32 public x; function setX(bytes32 _x) { x = _x; } }
ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let client = generate_dummy_client(0); let client = generate_dummy_client(0);
let chain_id = client.signing_chain_id(); let chain_id = client.signing_chain_id();
let key1 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000011")).unwrap(); let key1 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000011")).unwrap();

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> { 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 tests = ethjson::blockchain::Test::load(json_data).unwrap();
let mut failed = Vec::new(); let mut failed = Vec::new();

View File

@ -22,7 +22,7 @@ use spec::Spec;
use super::HookType; use super::HookType;
pub fn json_difficulty_test<H: FnMut(&str, HookType)>(json_data: &[u8], spec: Spec, start_stop_hook: &mut H) -> Vec<String> { 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 tests = ethjson::test::DifficultyTest::load(json_data).unwrap();
let engine = &spec.engine; 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> { 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 tests = ethjson::state::test::Test::load(json_data).unwrap();
let mut failed = Vec::new(); let mut failed = Vec::new();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,6 +33,7 @@ trace-time = "0.1"
triehash-ethereum = {version = "0.2", path = "../../util/triehash-ethereum" } triehash-ethereum = {version = "0.2", path = "../../util/triehash-ethereum" }
[dev-dependencies] [dev-dependencies]
env_logger = "0.5"
ethcore-io = { path = "../../util/io", features = ["mio"] } ethcore-io = { path = "../../util/io", features = ["mio"] }
ethkey = { path = "../../accounts/ethkey" } ethkey = { path = "../../accounts/ethkey" }
kvdb-memorydb = "0.1" kvdb-memorydb = "0.1"

View File

@ -22,7 +22,6 @@
//! //!
extern crate common_types as types; extern crate common_types as types;
extern crate env_logger;
extern crate ethcore; extern crate ethcore;
extern crate ethcore_io as io; extern crate ethcore_io as io;
extern crate ethcore_network as network; extern crate ethcore_network as network;
@ -39,10 +38,11 @@ extern crate triehash_ethereum;
extern crate ethcore_light as light; extern crate ethcore_light as light;
#[cfg(test)] extern crate env_logger;
#[cfg(test)] extern crate ethcore_private_tx;
#[cfg(test)] extern crate ethkey; #[cfg(test)] extern crate ethkey;
#[cfg(test)] extern crate kvdb_memorydb; #[cfg(test)] extern crate kvdb_memorydb;
#[cfg(test)] extern crate rustc_hex; #[cfg(test)] extern crate rustc_hex;
#[cfg(test)] extern crate ethcore_private_tx;
#[macro_use] #[macro_use]
extern crate macros; extern crate macros;

View File

@ -11,5 +11,7 @@ parity-wasm = "0.31"
libc = "0.2" libc = "0.2"
pwasm-utils = "0.6.1" pwasm-utils = "0.6.1"
vm = { path = "../vm" } vm = { path = "../vm" }
ethcore-logger = { path = "../../logger" }
wasmi = "0.3.0" wasmi = "0.3.0"
[dev-dependencies]
env_logger = "0.5"

View File

@ -12,7 +12,7 @@ ethjson = { path = "../../../json" }
vm = { path = "../../vm" } vm = { path = "../../vm" }
wasm = { path = "../" } wasm = { path = "../" }
clap = "2.24" clap = "2.24"
ethcore-logger = { path = "../../../logger" } env_logger = "0.5"
rustc-hex = "1" rustc-hex = "1"
[features] [features]

View File

@ -22,8 +22,8 @@ extern crate ethjson;
extern crate wasm; extern crate wasm;
extern crate vm; extern crate vm;
extern crate clap; extern crate clap;
extern crate ethcore_logger;
extern crate rustc_hex; extern crate rustc_hex;
extern crate env_logger;
mod fixture; mod fixture;
mod runner; mod runner;
@ -33,7 +33,7 @@ use clap::{App, Arg};
use std::fs; use std::fs;
fn main() { fn main() {
::ethcore_logger::init_log(); ::env_logger::init();
let matches = App::new("pwasm-run-test") let matches = App::new("pwasm-run-test")
.arg(Arg::with_name("target") .arg(Arg::with_name("target")

View File

@ -17,7 +17,6 @@
//! Wasm Interpreter //! Wasm Interpreter
extern crate byteorder; extern crate byteorder;
extern crate ethcore_logger;
extern crate ethereum_types; extern crate ethereum_types;
#[macro_use] extern crate log; #[macro_use] extern crate log;
extern crate libc; extern crate libc;
@ -26,12 +25,17 @@ extern crate vm;
extern crate pwasm_utils as wasm_utils; extern crate pwasm_utils as wasm_utils;
extern crate wasmi; extern crate wasmi;
mod runtime;
#[cfg(test)] #[cfg(test)]
mod tests; extern crate env_logger;
mod env; mod env;
mod panic_payload; mod panic_payload;
mod parser; mod parser;
mod runtime;
#[cfg(test)]
mod tests;
use vm::{GasLeft, ReturnData, ActionParams}; use vm::{GasLeft, ReturnData, ActionParams};
use wasmi::{Error as InterpreterError, Trap}; use wasmi::{Error as InterpreterError, Trap};

View File

@ -35,7 +35,7 @@ macro_rules! reqrep_test {
}; };
($name: expr, $input: expr, $info: expr, $block_hashes: expr) => { ($name: expr, $input: expr, $info: expr, $block_hashes: expr) => {
{ {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!($name); let code = load_sample!($name);
let mut params = ActionParams::default(); let mut params = ActionParams::default();
@ -94,7 +94,7 @@ fn empty() {
// logger.wasm writes all these provided fixed header fields to some arbitrary storage keys. // logger.wasm writes all these provided fixed header fields to some arbitrary storage keys.
#[test] #[test]
fn logger() { fn logger() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("logger.wasm"); let code = load_sample!("logger.wasm");
let address: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap(); let address: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap();
@ -148,7 +148,7 @@ fn logger() {
// if it has any result. // if it has any result.
#[test] #[test]
fn identity() { fn identity() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("identity.wasm"); let code = load_sample!("identity.wasm");
let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap(); let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap();
@ -182,7 +182,7 @@ fn identity() {
// This also tests byte-perfect memory allocation and in/out ptr lifecycle. // This also tests byte-perfect memory allocation and in/out ptr lifecycle.
#[test] #[test]
fn dispersion() { fn dispersion() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("dispersion.wasm"); let code = load_sample!("dispersion.wasm");
@ -240,7 +240,7 @@ fn suicide_not() {
#[test] #[test]
fn suicide() { fn suicide() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("suicidal.wasm"); let code = load_sample!("suicidal.wasm");
@ -272,7 +272,7 @@ fn suicide() {
#[test] #[test]
fn create() { fn create() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let mut params = ActionParams::default(); let mut params = ActionParams::default();
params.gas = U256::from(100_000); params.gas = U256::from(100_000);
@ -328,7 +328,7 @@ fn create() {
#[test] #[test]
fn call_msg() { fn call_msg() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap(); let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap();
let receiver: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap(); let receiver: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap();
@ -375,7 +375,7 @@ fn call_msg() {
// value as `gas` argument to the inner pwasm_ethereum::call // value as `gas` argument to the inner pwasm_ethereum::call
#[test] #[test]
fn call_msg_gasleft() { fn call_msg_gasleft() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap(); let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap();
let receiver: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap(); let receiver: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap();
@ -421,7 +421,7 @@ fn call_msg_gasleft() {
#[test] #[test]
fn call_code() { fn call_code() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap(); let sender: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap();
let receiver: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap(); let receiver: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap();
@ -467,7 +467,7 @@ fn call_code() {
#[test] #[test]
fn call_static() { fn call_static() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let sender: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap(); let sender: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap();
let receiver: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap(); let receiver: Address = "01030507090b0d0f11131517191b1d1f21232527".parse().unwrap();
@ -563,7 +563,7 @@ fn alloc() {
// Test prepopulates address into storage, than executes a contract which read that address from storage and write this address into result // Test prepopulates address into storage, than executes a contract which read that address from storage and write this address into result
#[test] #[test]
fn storage_read() { fn storage_read() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("storage_read.wasm"); let code = load_sample!("storage_read.wasm");
let address: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap(); let address: Address = "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6".parse().unwrap();
@ -591,7 +591,7 @@ fn storage_read() {
// keccak.wasm runs wasm-std::keccak function on data param and returns hash // keccak.wasm runs wasm-std::keccak function on data param and returns hash
#[test] #[test]
fn keccak() { fn keccak() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("keccak.wasm"); let code = load_sample!("keccak.wasm");
let mut params = ActionParams::default(); let mut params = ActionParams::default();
@ -730,7 +730,7 @@ fn math_div() {
#[test] #[test]
fn storage_metering() { fn storage_metering() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
// #1 // #1
let mut ext = FakeExt::new().with_wasm(); let mut ext = FakeExt::new().with_wasm();
@ -866,7 +866,7 @@ fn externs() {
// This test checks the ability of wasm contract to invoke gasleft // This test checks the ability of wasm contract to invoke gasleft
#[test] #[test]
fn gasleft() { fn gasleft() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let mut params = ActionParams::default(); let mut params = ActionParams::default();
params.gas = U256::from(100_000); params.gas = U256::from(100_000);
@ -891,7 +891,7 @@ fn gasleft() {
// ext.schedule.wasm.as_mut().unwrap().have_gasleft = false; // ext.schedule.wasm.as_mut().unwrap().have_gasleft = false;
#[test] #[test]
fn gasleft_fail() { fn gasleft_fail() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let mut params = ActionParams::default(); let mut params = ActionParams::default();
params.gas = U256::from(100_000); params.gas = U256::from(100_000);
@ -906,7 +906,7 @@ fn gasleft_fail() {
#[test] #[test]
fn embedded_keccak() { fn embedded_keccak() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let mut code = load_sample!("keccak.wasm"); let mut code = load_sample!("keccak.wasm");
code.extend_from_slice(b"something"); code.extend_from_slice(b"something");
@ -935,7 +935,7 @@ fn embedded_keccak() {
/// and reversed input as a data /// and reversed input as a data
#[test] #[test]
fn events() { fn events() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("events.wasm"); let code = load_sample!("events.wasm");
let mut params = ActionParams::default(); let mut params = ActionParams::default();
@ -967,7 +967,7 @@ fn events() {
#[test] #[test]
fn recursive() { fn recursive() {
::ethcore_logger::init_log(); let _ = ::env_logger::try_init();
let code = load_sample!("recursive.wasm"); let code = load_sample!("recursive.wasm");
let mut params = ActionParams::default(); let mut params = ActionParams::default();

View File

@ -18,4 +18,3 @@ parking_lot = "0.7"
env_logger = "0.5" env_logger = "0.5"
tokio = "0.1" tokio = "0.1"
tokio-io = "0.1" tokio-io = "0.1"
ethcore-logger = { path = "../../logger" }

View File

@ -27,7 +27,7 @@ extern crate parking_lot;
#[cfg(test)] extern crate tokio; #[cfg(test)] extern crate tokio;
#[cfg(test)] extern crate tokio_io; #[cfg(test)] extern crate tokio_io;
#[cfg(test)] extern crate ethcore_logger; #[cfg(test)] extern crate env_logger;
mod traits; mod traits;
@ -329,8 +329,6 @@ mod tests {
use tokio::{io, runtime::Runtime, timer::timeout::{self, Timeout}, net::TcpStream}; use tokio::{io, runtime::Runtime, timer::timeout::{self, Timeout}, net::TcpStream};
use jsonrpc_core::futures::{Future, future}; use jsonrpc_core::futures::{Future, future};
use ethcore_logger::init_log;
pub struct VoidManager; pub struct VoidManager;
impl JobDispatcher for VoidManager { impl JobDispatcher for VoidManager {
@ -369,7 +367,7 @@ mod tests {
#[test] #[test]
fn records_subscriber() { fn records_subscriber() {
init_log(); let _ = ::env_logger::try_init();
let addr = "127.0.0.1:19985".parse().unwrap(); let addr = "127.0.0.1:19985".parse().unwrap();
let stratum = Stratum::start(&addr, Arc::new(VoidManager), None).unwrap(); let stratum = Stratum::start(&addr, Arc::new(VoidManager), None).unwrap();
@ -443,7 +441,7 @@ mod tests {
#[test] #[test]
fn can_push_work() { fn can_push_work() {
init_log(); let _ = ::env_logger::try_init();
let addr = "127.0.0.1:19995".parse().unwrap(); let addr = "127.0.0.1:19995".parse().unwrap();
let stratum = Stratum::start( let stratum = Stratum::start(

View File

@ -23,7 +23,6 @@ extern crate docopt;
#[macro_use] #[macro_use]
extern crate clap; extern crate clap;
extern crate dir; extern crate dir;
extern crate env_logger;
extern crate futures; extern crate futures;
extern crate atty; extern crate atty;
extern crate jsonrpc_core; extern crate jsonrpc_core;

View File

@ -42,7 +42,7 @@ parity-bytes = "0.1"
parity-crypto = "0.2" parity-crypto = "0.2"
ethcore-io = { path = "../util/io" } ethcore-io = { path = "../util/io" }
ethcore-light = { path = "../ethcore/light" } ethcore-light = { path = "../ethcore/light" }
ethcore-logger = { path = "../logger" } ethcore-logger = { path = "../parity/logger" }
ethcore-miner = { path = "../miner" } ethcore-miner = { path = "../miner" }
ethcore-private-tx = { path = "../ethcore/private-tx" } ethcore-private-tx = { path = "../ethcore/private-tx" }
ethcore-sync = { path = "../ethcore/sync" } ethcore-sync = { path = "../ethcore/sync" }

View File

@ -167,6 +167,7 @@ impl<C, M, U, S> Parity for ParityClient<C, M, U> where
} }
fn dev_logs(&self) -> Result<Vec<String>> { fn dev_logs(&self) -> Result<Vec<String>> {
warn!("This method is deprecated and will be removed in future. See PR #10102");
let logs = self.logger.logs(); let logs = self.logger.logs();
Ok(logs.as_slice().to_owned()) Ok(logs.as_slice().to_owned())
} }

View File

@ -25,7 +25,6 @@ url = "1.0"
ethcore = { path = "../ethcore" } ethcore = { path = "../ethcore" }
parity-bytes = "0.1" parity-bytes = "0.1"
parity-crypto = "0.2" parity-crypto = "0.2"
ethcore-logger = { path = "../logger" }
ethcore-sync = { path = "../ethcore/sync" } ethcore-sync = { path = "../ethcore/sync" }
ethereum-types = "0.4" ethereum-types = "0.4"
kvdb = "0.1" kvdb = "0.1"
@ -37,6 +36,7 @@ ethabi-derive = "6.0"
ethabi-contract = "6.0" ethabi-contract = "6.0"
[dev-dependencies] [dev-dependencies]
env_logger = "0.5"
ethcore = { path = "../ethcore", features = ["test-helpers"] } ethcore = { path = "../ethcore", features = ["test-helpers"] }
tempdir = "0.3" tempdir = "0.3"
kvdb-rocksdb = "0.1.3" kvdb-rocksdb = "0.1.3"

View File

@ -325,7 +325,7 @@ pub mod tests {
#[test] #[test]
fn document_key_generation_and_retrievement_works_over_network_with_single_node() { fn document_key_generation_and_retrievement_works_over_network_with_single_node() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, _, runtime) = make_key_servers(6070, 1); let (key_servers, _, runtime) = make_key_servers(6070, 1);
// generate document key // generate document key
@ -347,7 +347,7 @@ pub mod tests {
#[test] #[test]
fn document_key_generation_and_retrievement_works_over_network_with_3_nodes() { fn document_key_generation_and_retrievement_works_over_network_with_3_nodes() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, key_storages, runtime) = make_key_servers(6080, 3); let (key_servers, key_storages, runtime) = make_key_servers(6080, 3);
let test_cases = [0, 1, 2]; let test_cases = [0, 1, 2];
@ -375,7 +375,7 @@ pub mod tests {
#[test] #[test]
fn server_key_generation_and_storing_document_key_works_over_network_with_3_nodes() { fn server_key_generation_and_storing_document_key_works_over_network_with_3_nodes() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, _, runtime) = make_key_servers(6090, 3); let (key_servers, _, runtime) = make_key_servers(6090, 3);
let test_cases = [0, 1, 2]; let test_cases = [0, 1, 2];
@ -407,7 +407,7 @@ pub mod tests {
#[test] #[test]
fn server_key_generation_and_message_signing_works_over_network_with_3_nodes() { fn server_key_generation_and_message_signing_works_over_network_with_3_nodes() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, _, runtime) = make_key_servers(6100, 3); let (key_servers, _, runtime) = make_key_servers(6100, 3);
let test_cases = [0, 1, 2]; let test_cases = [0, 1, 2];
@ -433,7 +433,7 @@ pub mod tests {
#[test] #[test]
fn decryption_session_is_delegated_when_node_does_not_have_key_share() { fn decryption_session_is_delegated_when_node_does_not_have_key_share() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, _, runtime) = make_key_servers(6110, 3); let (key_servers, _, runtime) = make_key_servers(6110, 3);
// generate document key // generate document key
@ -456,7 +456,7 @@ pub mod tests {
#[test] #[test]
fn schnorr_signing_session_is_delegated_when_node_does_not_have_key_share() { fn schnorr_signing_session_is_delegated_when_node_does_not_have_key_share() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, _, runtime) = make_key_servers(6114, 3); let (key_servers, _, runtime) = make_key_servers(6114, 3);
let threshold = 1; let threshold = 1;
@ -483,7 +483,7 @@ pub mod tests {
#[test] #[test]
fn ecdsa_signing_session_is_delegated_when_node_does_not_have_key_share() { fn ecdsa_signing_session_is_delegated_when_node_does_not_have_key_share() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let (key_servers, _, runtime) = make_key_servers(6117, 4); let (key_servers, _, runtime) = make_key_servers(6117, 4);
let threshold = 1; let threshold = 1;

View File

@ -1360,7 +1360,7 @@ pub mod tests {
#[test] #[test]
fn error_in_generation_session_broadcasted_to_all_other_nodes() { fn error_in_generation_session_broadcasted_to_all_other_nodes() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let runtime = new_runtime(); let runtime = new_runtime();
let clusters = make_clusters(&runtime, 6016, 3); let clusters = make_clusters(&runtime, 6016, 3);
run_clusters(&clusters); run_clusters(&clusters);
@ -1395,7 +1395,7 @@ pub mod tests {
#[test] #[test]
fn generation_session_completion_signalled_if_failed_on_master() { fn generation_session_completion_signalled_if_failed_on_master() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let runtime = new_runtime(); let runtime = new_runtime();
let clusters = make_clusters(&runtime, 6025, 3); let clusters = make_clusters(&runtime, 6025, 3);
run_clusters(&clusters); run_clusters(&clusters);
@ -1430,7 +1430,7 @@ pub mod tests {
#[test] #[test]
fn generation_session_is_removed_when_succeeded() { fn generation_session_is_removed_when_succeeded() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let runtime = new_runtime(); let runtime = new_runtime();
let clusters = make_clusters(&runtime, 6019, 3); let clusters = make_clusters(&runtime, 6019, 3);
run_clusters(&clusters); run_clusters(&clusters);
@ -1506,7 +1506,7 @@ pub mod tests {
#[test] #[test]
#[ignore] #[ignore]
fn schnorr_signing_session_completes_if_node_does_not_have_a_share() { fn schnorr_signing_session_completes_if_node_does_not_have_a_share() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let runtime = new_runtime(); let runtime = new_runtime();
let clusters = make_clusters(&runtime, 6028, 3); let clusters = make_clusters(&runtime, 6028, 3);
run_clusters(&clusters); run_clusters(&clusters);
@ -1568,7 +1568,7 @@ pub mod tests {
#[test] #[test]
#[ignore] #[ignore]
fn ecdsa_signing_session_completes_if_node_does_not_have_a_share() { fn ecdsa_signing_session_completes_if_node_does_not_have_a_share() {
//::logger::init_log(); let _ = ::env_logger::try_init();
let runtime = new_runtime(); let runtime = new_runtime();
let clusters = make_clusters(&runtime, 6041, 4); let clusters = make_clusters(&runtime, 6041, 4);
run_clusters(&clusters); run_clusters(&clusters);

View File

@ -18,7 +18,6 @@ extern crate byteorder;
extern crate common_types; extern crate common_types;
extern crate ethabi; extern crate ethabi;
extern crate ethcore; extern crate ethcore;
extern crate ethcore_logger as logger;
extern crate ethcore_sync as sync; extern crate ethcore_sync as sync;
extern crate ethereum_types; extern crate ethereum_types;
extern crate ethkey; extern crate ethkey;
@ -51,6 +50,8 @@ extern crate lazy_static;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
#[cfg(test)]
extern crate env_logger;
#[cfg(test)] #[cfg(test)]
extern crate kvdb_rocksdb; extern crate kvdb_rocksdb;

View File

@ -19,6 +19,6 @@ fastmap = { path = "../../util/fastmap" }
rlp = { version = "0.3.0", features = ["ethereum"] } rlp = { version = "0.3.0", features = ["ethereum"] }
[dev-dependencies] [dev-dependencies]
ethcore-logger = { path = "../../logger" } env_logger = "0.5"
keccak-hash = "0.1" keccak-hash = "0.1"
kvdb-memorydb = "0.1" kvdb-memorydb = "0.1"

View File

@ -526,7 +526,6 @@ mod tests {
use hashdb::HashDB; use hashdb::HashDB;
use super::*; use super::*;
use super::super::traits::JournalDB; use super::super::traits::JournalDB;
use ethcore_logger::init_log;
use kvdb_memorydb; use kvdb_memorydb;
#[test] #[test]
@ -823,7 +822,7 @@ mod tests {
#[test] #[test]
fn insert_delete_insert_delete_insert_expunge() { fn insert_delete_insert_delete_insert_expunge() {
init_log(); let _ = ::env_logger::try_init();
let mut jdb = new_db(); let mut jdb = new_db();
@ -850,7 +849,7 @@ mod tests {
#[test] #[test]
fn forked_insert_delete_insert_delete_insert_expunge() { fn forked_insert_delete_insert_delete_insert_expunge() {
init_log(); let _ = ::env_logger::try_init();
let mut jdb = new_db(); let mut jdb = new_db();
// history is 4 // history is 4
@ -959,7 +958,7 @@ mod tests {
#[test] #[test]
fn reopen_remove_three() { fn reopen_remove_three() {
init_log(); let _ = ::env_logger::try_init();
let shared_db = Arc::new(kvdb_memorydb::create(0)); let shared_db = Arc::new(kvdb_memorydb::create(0));
let foo = keccak(b"foo"); let foo = keccak(b"foo");

View File

@ -31,7 +31,7 @@ extern crate fastmap;
extern crate rlp; extern crate rlp;
#[cfg(test)] #[cfg(test)]
extern crate ethcore_logger; extern crate env_logger;
#[cfg(test)] #[cfg(test)]
extern crate keccak_hash as keccak; extern crate keccak_hash as keccak;
#[cfg(test)] #[cfg(test)]

View File

@ -494,7 +494,6 @@ mod tests {
use keccak::keccak; use keccak::keccak;
use super::*; use super::*;
use hashdb::HashDB; use hashdb::HashDB;
use ethcore_logger::init_log;
use {kvdb_memorydb, JournalDB}; use {kvdb_memorydb, JournalDB};
fn new_db() -> OverlayRecentDB { fn new_db() -> OverlayRecentDB {
@ -772,7 +771,7 @@ mod tests {
#[test] #[test]
fn insert_delete_insert_delete_insert_expunge() { fn insert_delete_insert_delete_insert_expunge() {
init_log(); let _ = ::env_logger::try_init();
let mut jdb = new_db(); let mut jdb = new_db();
// history is 4 // history is 4
@ -798,7 +797,7 @@ mod tests {
#[test] #[test]
fn forked_insert_delete_insert_delete_insert_expunge() { fn forked_insert_delete_insert_delete_insert_expunge() {
init_log(); let _ = ::env_logger::try_init();
let mut jdb = new_db(); let mut jdb = new_db();
// history is 4 // history is 4
@ -905,7 +904,7 @@ mod tests {
#[test] #[test]
fn reopen_remove_three() { fn reopen_remove_three() {
init_log(); let _ = ::env_logger::try_init();
let shared_db = Arc::new(kvdb_memorydb::create(0)); let shared_db = Arc::new(kvdb_memorydb::create(0));
let foo = keccak(b"foo"); let foo = keccak(b"foo");

View File

@ -22,7 +22,6 @@ rustc-hex = "1.0"
ethcore-io = { path = "../io", features = ["mio"] } ethcore-io = { path = "../io", features = ["mio"] }
parity-bytes = "0.1" parity-bytes = "0.1"
parity-crypto = "0.2" parity-crypto = "0.2"
ethcore-logger = { path ="../../logger" }
ethcore-network = { path = "../network" } ethcore-network = { path = "../network" }
ethereum-types = "0.4" ethereum-types = "0.4"
ethkey = { path = "../../accounts/ethkey" } ethkey = { path = "../../accounts/ethkey" }
@ -37,6 +36,7 @@ serde_derive = "1.0"
error-chain = { version = "0.12", default-features = false } error-chain = { version = "0.12", default-features = false }
[dev-dependencies] [dev-dependencies]
env_logger = "0.5"
tempdir = "0.3" tempdir = "0.3"
assert_matches = "1.2" assert_matches = "1.2"

View File

@ -78,7 +78,6 @@ extern crate ethkey;
extern crate rlp; extern crate rlp;
extern crate bytes; extern crate bytes;
extern crate parity_path; extern crate parity_path;
extern crate ethcore_logger;
extern crate ethcore_network as network; extern crate ethcore_network as network;
extern crate ipnetwork; extern crate ipnetwork;
extern crate keccak_hash as hash; extern crate keccak_hash as hash;
@ -93,6 +92,8 @@ extern crate log;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
#[cfg(test)]
extern crate env_logger;
#[cfg(test)] #[cfg(test)]
extern crate tempdir; extern crate tempdir;
#[cfg(test)] #[macro_use] #[cfg(test)] #[macro_use]

View File

@ -14,13 +14,13 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>. // along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
extern crate parking_lot; extern crate env_logger;
extern crate parity_bytes;
extern crate ethcore_io as io; extern crate ethcore_io as io;
extern crate ethcore_logger;
extern crate ethcore_network; extern crate ethcore_network;
extern crate ethcore_network_devp2p; extern crate ethcore_network_devp2p;
extern crate ethkey; extern crate ethkey;
extern crate parity_bytes;
extern crate parking_lot;
use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering}; use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering};
use std::sync::Arc; use std::sync::Arc;

View File

@ -6,18 +6,18 @@ authors = ["Parity Technologies <admin@parity.io>"]
license = "GPL-3.0" license = "GPL-3.0"
[dependencies] [dependencies]
ethcore-network-devp2p = { path = "../../util/network-devp2p" }
ethcore-network = { path = "../../util/network" }
ethcore-logger = { path = "../../logger" }
parity-whisper = { path = "../" }
docopt = "1.0" docopt = "1.0"
env_logger = "0.5"
ethcore-network = { path = "../../util/network" }
ethcore-network-devp2p = { path = "../../util/network-devp2p" }
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
log = "0.4"
panic_hook = { path = "../../util/panic-hook" }
parity-whisper = { path = "../" }
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
panic_hook = { path = "../../util/panic-hook" }
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
log = "0.4"
[[bin]] [[bin]]
name = "whisper" name = "whisper"

View File

@ -23,16 +23,16 @@
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
extern crate docopt; extern crate docopt;
extern crate ethcore_network_devp2p as devp2p; extern crate env_logger;
extern crate ethcore_network as net; extern crate ethcore_network as net;
extern crate ethcore_network_devp2p as devp2p;
extern crate panic_hook;
extern crate parity_whisper as whisper; extern crate parity_whisper as whisper;
extern crate serde; extern crate serde;
extern crate panic_hook;
extern crate jsonrpc_core; extern crate jsonrpc_core;
extern crate jsonrpc_pubsub; extern crate jsonrpc_pubsub;
extern crate jsonrpc_http_server; extern crate jsonrpc_http_server;
extern crate ethcore_logger as log;
#[macro_use] #[macro_use]
extern crate log as rlog; extern crate log as rlog;
@ -131,7 +131,6 @@ enum Error {
JsonRpc(jsonrpc_core::Error), JsonRpc(jsonrpc_core::Error),
Network(net::Error), Network(net::Error),
SockAddr(std::net::AddrParseError), SockAddr(std::net::AddrParseError),
Logger(String),
} }
impl From<std::net::AddrParseError> for Error { impl From<std::net::AddrParseError> for Error {
@ -164,12 +163,6 @@ impl From<jsonrpc_core::Error> for Error {
} }
} }
impl From<String> for Error {
fn from(err: String) -> Self {
Error::Logger(err)
}
}
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match *self { match *self {
@ -178,7 +171,6 @@ impl fmt::Display for Error {
Error::Io(ref e) => write!(f, "{}", e), Error::Io(ref e) => write!(f, "{}", e),
Error::JsonRpc(ref e) => write!(f, "{:?}", e), Error::JsonRpc(ref e) => write!(f, "{:?}", e),
Error::Network(ref e) => write!(f, "{}", e), Error::Network(ref e) => write!(f, "{}", e),
Error::Logger(ref e) => write!(f, "{}", e),
} }
} }
} }
@ -206,7 +198,7 @@ fn execute<S, I>(command: I) -> Result<(), Error> where I: IntoIterator<Item=S>,
let pool_size = args.flag_whisper_pool_size * POOL_UNIT; let pool_size = args.flag_whisper_pool_size * POOL_UNIT;
let url = format!("{}:{}", args.flag_address, args.flag_port); let url = format!("{}:{}", args.flag_address, args.flag_port);
initialize_logger(args.flag_log)?; initialize_logger(args.flag_log);
info!(target: "whisper-cli", "start"); info!(target: "whisper-cli", "start");
// Filter manager that will dispatch `decryption tasks` // Filter manager that will dispatch `decryption tasks`
@ -249,11 +241,10 @@ fn execute<S, I>(command: I) -> Result<(), Error> where I: IntoIterator<Item=S>,
Ok(()) Ok(())
} }
fn initialize_logger(log_level: String) -> Result<(), String> { fn initialize_logger(log_level: String) {
let mut l = log::Config::default(); env_logger::Builder::from_env(env_logger::Env::default())
l.mode = Some(log_level); .parse(&log_level)
log::setup_log(&l)?; .init();
Ok(())
} }
#[cfg(test)] #[cfg(test)]