splitting part of util into smaller crates (#4956)

* split path module from util

* moved RotatingLogger from util to logger crate

* fix tests

* fix tests

* use only one version of ansi_term crate
This commit is contained in:
Marek Kotewicz 2017-03-22 06:23:40 +01:00 committed by GitHub
parent 63f1ca9243
commit d530cc86f3
42 changed files with 93 additions and 80 deletions

40
Cargo.lock generated
View File

@ -2,7 +2,7 @@
name = "parity" name = "parity"
version = "1.7.0" version = "1.7.0"
dependencies = [ dependencies = [
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"ctrlc 1.1.1 (git+https://github.com/ethcore/rust-ctrlc.git)", "ctrlc 1.1.1 (git+https://github.com/ethcore/rust-ctrlc.git)",
@ -39,6 +39,7 @@ dependencies = [
"parity-reactor 0.1.0", "parity-reactor 0.1.0",
"parity-rpc-client 1.4.0", "parity-rpc-client 1.4.0",
"parity-updater 1.7.0", "parity-updater 1.7.0",
"path 0.1.0",
"regex 0.1.68 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.68 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.1.0", "rlp 0.1.0",
"rpassword 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -72,7 +73,7 @@ dependencies = [
[[package]] [[package]]
name = "ansi_term" name = "ansi_term"
version = "0.7.2" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -93,10 +94,10 @@ dependencies = [
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
version = "0.3.16" version = "0.3.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"nodrop 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "nodrop 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -347,7 +348,7 @@ name = "eth-secp256k1"
version = "0.5.6" version = "0.5.6"
source = "git+https://github.com/ethcore/rust-secp256k1#98ad9b9ecae44a563efdd64273bcebc6b4ed81c6" source = "git+https://github.com/ethcore/rust-secp256k1#98ad9b9ecae44a563efdd64273bcebc6b4ed81c6"
dependencies = [ dependencies = [
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -394,6 +395,7 @@ dependencies = [
"ethcore-ipc 1.7.0", "ethcore-ipc 1.7.0",
"ethcore-ipc-codegen 1.7.0", "ethcore-ipc-codegen 1.7.0",
"ethcore-ipc-nano 1.7.0", "ethcore-ipc-nano 1.7.0",
"ethcore-logger 1.7.0",
"ethcore-stratum 1.7.0", "ethcore-stratum 1.7.0",
"ethcore-util 1.7.0", "ethcore-util 1.7.0",
"ethjson 0.1.0", "ethjson 0.1.0",
@ -570,11 +572,13 @@ dependencies = [
name = "ethcore-logger" name = "ethcore-logger"
version = "1.7.0" version = "1.7.0"
dependencies = [ dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-util 1.7.0",
"isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.68 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.68 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -583,10 +587,11 @@ dependencies = [
name = "ethcore-network" name = "ethcore-network"
version = "1.7.0" version = "1.7.0"
dependencies = [ dependencies = [
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-devtools 1.7.0", "ethcore-devtools 1.7.0",
"ethcore-io 1.7.0", "ethcore-io 1.7.0",
"ethcore-logger 1.7.0",
"ethcore-util 1.7.0", "ethcore-util 1.7.0",
"ethcrypto 0.1.0", "ethcrypto 0.1.0",
"ethkey 0.2.0", "ethkey 0.2.0",
@ -595,6 +600,7 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mio 0.6.1 (git+https://github.com/ethcore/mio)", "mio 0.6.1 (git+https://github.com/ethcore/mio)",
"parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.1.0", "rlp 0.1.0",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
@ -615,6 +621,7 @@ dependencies = [
"ethcore-io 1.7.0", "ethcore-io 1.7.0",
"ethcore-ipc 1.7.0", "ethcore-ipc 1.7.0",
"ethcore-light 1.7.0", "ethcore-light 1.7.0",
"ethcore-logger 1.7.0",
"ethcore-util 1.7.0", "ethcore-util 1.7.0",
"ethcrypto 0.1.0", "ethcrypto 0.1.0",
"ethjson 0.1.0", "ethjson 0.1.0",
@ -687,6 +694,7 @@ dependencies = [
"ethcore-ipc 1.7.0", "ethcore-ipc 1.7.0",
"ethcore-ipc-codegen 1.7.0", "ethcore-ipc-codegen 1.7.0",
"ethcore-ipc-nano 1.7.0", "ethcore-ipc-nano 1.7.0",
"ethcore-logger 1.7.0",
"ethcore-util 1.7.0", "ethcore-util 1.7.0",
"futures 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 6.0.0 (git+https://github.com/ethcore/jsonrpc.git?branch=parity-1.6)", "jsonrpc-core 6.0.0 (git+https://github.com/ethcore/jsonrpc.git?branch=parity-1.6)",
@ -703,8 +711,7 @@ dependencies = [
name = "ethcore-util" name = "ethcore-util"
version = "1.7.0" version = "1.7.0"
dependencies = [ dependencies = [
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"elastic-array 0.6.0 (git+https://github.com/ethcore/elastic-array)", "elastic-array 0.6.0 (git+https://github.com/ethcore/elastic-array)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -712,9 +719,9 @@ dependencies = [
"ethcore-bigint 0.1.2", "ethcore-bigint 0.1.2",
"ethcore-bloom-journal 0.1.0", "ethcore-bloom-journal 0.1.0",
"ethcore-devtools 1.7.0", "ethcore-devtools 1.7.0",
"ethcore-logger 1.7.0",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1457,7 +1464,7 @@ dependencies = [
[[package]] [[package]]
name = "nodrop" name = "nodrop"
version = "0.1.6" version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1719,6 +1726,7 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.7.0", "parity-hash-fetch 1.7.0",
"parity-reactor 0.1.0", "parity-reactor 0.1.0",
"path 0.1.0",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1743,6 +1751,10 @@ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "path"
version = "0.1.0"
[[package]] [[package]]
name = "phf" name = "phf"
version = "0.7.14" version = "0.7.14"
@ -2601,10 +2613,10 @@ dependencies = [
[metadata] [metadata]
"checksum advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a" "checksum advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a"
"checksum aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67077478f0a03952bed2e6786338d400d40c25e9836e08ad50af96607317fd03" "checksum aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67077478f0a03952bed2e6786338d400d40c25e9836e08ad50af96607317fd03"
"checksum ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1f46cd5b1d660c938e3f92dfe7a73d832b3281479363dd0cd9c1c2fbf60f7962" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5"
"checksum app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7d1c0d48a81bbb13043847f957971f4d87c81542d80ece5e84ba3cba4058fd4" "checksum app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7d1c0d48a81bbb13043847f957971f4d87c81542d80ece5e84ba3cba4058fd4"
"checksum arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "16e3bdb2f54b3ace0285975d59a97cf8ed3855294b2b6bc651fcf22a9c352975" "checksum arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d89f1b0e242270b5b797778af0c8d182a1a2ccac5d8d6fadf414223cc0fab096"
"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0"
"checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1" "checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1"
"checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c" "checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c"
@ -2699,7 +2711,7 @@ dependencies = [
"checksum nix 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f05c2fc965fc1cd6b73fa57fa7b89f288178737f2f3ce9e63e4a6a141189000e" "checksum nix 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f05c2fc965fc1cd6b73fa57fa7b89f288178737f2f3ce9e63e4a6a141189000e"
"checksum nix 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a7bb1da2be7da3cbffda73fc681d509ffd9e665af478d2bee1907cee0bc64b2" "checksum nix 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a7bb1da2be7da3cbffda73fc681d509ffd9e665af478d2bee1907cee0bc64b2"
"checksum nix 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d95c5fa8b641c10ad0b8887454ebaafa3c92b5cd5350f8fc693adafd178e7b" "checksum nix 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d95c5fa8b641c10ad0b8887454ebaafa3c92b5cd5350f8fc693adafd178e7b"
"checksum nodrop 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4d9a22dbcebdeef7bf275cbf444d6521d4e7a2fee187b72d80dba0817120dd8f" "checksum nodrop 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "52cd74cd09beba596430cc6e3091b74007169a56246e1262f0ba451ea95117b2"
"checksum nom 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6caab12c5f97aa316cb249725aa32115118e1522b445e26c257dd77cad5ffd4e" "checksum nom 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6caab12c5f97aa316cb249725aa32115118e1522b445e26c257dd77cad5ffd4e"
"checksum num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "c04bd954dbf96f76bab6e5bd6cef6f1ce1262d15268ce4f926d2b5b778fa7af2" "checksum num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "c04bd954dbf96f76bab6e5bd6cef6f1ce1262d15268ce4f926d2b5b778fa7af2"
"checksum num-bigint 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "41655c8d667be847a0b72fe0888857a7b3f052f691cf40852be5fcf87b274a65" "checksum num-bigint 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "41655c8d667be847a0b72fe0888857a7b3f052f691cf40852be5fcf87b274a65"

View File

@ -16,7 +16,7 @@ num_cpus = "1.2"
number_prefix = "0.2" number_prefix = "0.2"
rpassword = "0.2.1" rpassword = "0.2.1"
semver = "0.5" semver = "0.5"
ansi_term = "0.7" ansi_term = "0.9"
regex = "0.1" regex = "0.1"
isatty = "0.1" isatty = "0.1"
toml = "0.2" toml = "0.2"
@ -50,6 +50,7 @@ parity-updater = { path = "updater" }
parity-reactor = { path = "util/reactor" } parity-reactor = { path = "util/reactor" }
parity-local-store = { path = "local-store" } parity-local-store = { path = "local-store" }
ethcore-dapps = { path = "dapps", optional = true } ethcore-dapps = { path = "dapps", optional = true }
path = { path = "util/path" }
clippy = { version = "0.0.103", optional = true} clippy = { version = "0.0.103", optional = true}
ethcore-secretstore = { path = "secret_store", optional = true } ethcore-secretstore = { path = "secret_store", optional = true }

View File

@ -43,6 +43,7 @@ rlp = { path = "../util/rlp" }
ethcore-stratum = { path = "../stratum" } ethcore-stratum = { path = "../stratum" }
ethcore-bloom-journal = { path = "../util/bloom" } ethcore-bloom-journal = { path = "../util/bloom" }
hardware-wallet = { path = "../hw" } hardware-wallet = { path = "../hw" }
ethcore-logger = { path = "../logger" }
stats = { path = "../util/stats" } stats = { path = "../util/stats" }
num = "0.1" num = "0.1"

View File

@ -25,7 +25,7 @@ use miner::Miner;
use io::IoChannel; use io::IoChannel;
pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> { pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
init_log(); ::ethcore_logger::init_log();
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 ethereum;
use ethjson; use ethjson;
pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> { pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
init_log(); ::ethcore_logger::init_log();
let tests = ethjson::state::Test::load(json_data).unwrap(); let tests = ethjson::state::Test::load(json_data).unwrap();
let mut failed = Vec::new(); let mut failed = Vec::new();
let engine = match era { let engine = match era {

View File

@ -106,6 +106,7 @@ extern crate ethcore_stratum;
extern crate ethabi; extern crate ethabi;
extern crate hardware_wallet; extern crate hardware_wallet;
extern crate stats; extern crate stats;
extern crate ethcore_logger;
extern crate num; extern crate num;
#[macro_use] #[macro_use]

View File

@ -110,7 +110,7 @@ impl PriceInfo {
fn should_get_price_info() { fn should_get_price_info() {
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use util::log::init_log; use ethcore_logger::init_log;
use util::{Condvar, Mutex}; use util::{Condvar, Mutex};
init_log(); init_log();

View File

@ -2454,6 +2454,7 @@ pub mod test {
#[test] #[test]
fn should_replace_same_transaction_when_has_higher_fee() { fn should_replace_same_transaction_when_has_higher_fee() {
use ethcore_logger::init_log;
init_log(); init_log();
// given // given
let mut txq = TransactionQueue::default(); let mut txq = TransactionQueue::default();

View File

@ -946,7 +946,7 @@ mod tests {
use env_info::EnvInfo; use env_info::EnvInfo;
use spec::*; use spec::*;
use transaction::*; use transaction::*;
use util::log::init_log; use ethcore_logger::init_log;
use trace::{FlatTrace, TraceError, trace}; use trace::{FlatTrace, TraceError, trace};
use types::executed::CallType; use types::executed::CallType;

View File

@ -457,7 +457,7 @@ mod tests {
use util::{U256, H256, Address, DBTransaction}; use util::{U256, H256, Address, DBTransaction};
use tests::helpers::*; use tests::helpers::*;
use state::{Account, Backend}; use state::{Account, Backend};
use util::log::init_log; use ethcore_logger::init_log;
#[test] #[test]
fn state_db_smoke() { fn state_db_smoke() {

View File

@ -8,11 +8,13 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies] [dependencies]
log = "0.3" log = "0.3"
env_logger = "0.3" env_logger = "0.3"
ethcore-util = { path = "../util" }
isatty = "0.1" isatty = "0.1"
lazy_static = "0.2" lazy_static = "0.2"
regex = "0.1" regex = "0.1"
time = "0.1" time = "0.1"
parking_lot = "0.3"
arrayvec = "0.3"
ansi_term = "0.9"
[profile.release] [profile.release]
debug = true debug = true

View File

@ -16,7 +16,7 @@
//! Logger for parity executables //! Logger for parity executables
extern crate ethcore_util as util; extern crate arrayvec;
extern crate log as rlog; extern crate log as rlog;
extern crate isatty; extern crate isatty;
extern crate regex; extern crate regex;
@ -24,6 +24,10 @@ extern crate env_logger;
extern crate time; extern crate time;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
extern crate parking_lot;
extern crate ansi_term;
mod rotating;
use std::{env, thread, fs}; use std::{env, thread, fs};
use std::sync::{Weak, Arc}; use std::sync::{Weak, Arc};
@ -31,8 +35,10 @@ use std::io::Write;
use isatty::{stderr_isatty, stdout_isatty}; use isatty::{stderr_isatty, stdout_isatty};
use env_logger::LogBuilder; use env_logger::LogBuilder;
use regex::Regex; use regex::Regex;
use util::{Mutex, RotatingLogger} ; use ansi_term::Colour;
use util::log::Colour; use parking_lot::Mutex;
pub use rotating::{RotatingLogger, init_log};
#[derive(Debug, PartialEq, Clone)] #[derive(Debug, PartialEq, Clone)]
pub struct Config { pub struct Config {

View File

@ -20,7 +20,6 @@ use std::env;
use rlog::LogLevelFilter; use rlog::LogLevelFilter;
use env_logger::LogBuilder; use env_logger::LogBuilder;
use arrayvec::ArrayVec; use arrayvec::ArrayVec;
pub use ansi_term::{Colour, Style};
use parking_lot::{RwLock, RwLockReadGuard}; use parking_lot::{RwLock, RwLockReadGuard};

View File

@ -22,7 +22,7 @@ use std::cmp::max;
use cli::{Args, ArgsError}; use cli::{Args, ArgsError};
use util::{Hashable, H256, U256, Uint, Bytes, version_data, Address}; use util::{Hashable, H256, U256, Uint, Bytes, version_data, Address};
use util::journaldb::Algorithm; use util::journaldb::Algorithm;
use util::log::Colour; use util::Colour;
use ethsync::{NetworkConfiguration, is_valid_node_url, AllowIP}; use ethsync::{NetworkConfiguration, is_valid_node_url, AllowIP};
use ethcore::ethstore::ethkey::Secret; use ethcore::ethstore::ethkey::Secret;
use ethcore::client::{VMType}; use ethcore::client::{VMType};
@ -824,7 +824,7 @@ impl Configuration {
} }
fn directories(&self) -> Directories { fn directories(&self) -> Directories {
use util::path; use path;
let local_path = default_local_path(); let local_path = default_local_path();
let base_path = self.args.flag_base_path.as_ref().map_or_else(|| default_data_path(), |s| s.clone()); let base_path = self.args.flag_base_path.as_ref().map_or_else(|| default_data_path(), |s| s.clone());

View File

@ -18,7 +18,7 @@ use std::{io, env};
use std::io::{Write, BufReader, BufRead}; use std::io::{Write, BufReader, BufRead};
use std::time::Duration; use std::time::Duration;
use std::fs::File; use std::fs::File;
use util::{clean_0x, U256, Uint, Address, path, CompactionProfile}; use util::{clean_0x, U256, Uint, Address, CompactionProfile};
use util::journaldb::Algorithm; use util::journaldb::Algorithm;
use ethcore::client::{Mode, BlockId, VMType, DatabaseCompactionProfile, ClientConfig, VerifierType}; use ethcore::client::{Mode, BlockId, VMType, DatabaseCompactionProfile, ClientConfig, VerifierType};
use ethcore::miner::{PendingSet, GasLimit, PrioritizationStrategy}; use ethcore::miner::{PendingSet, GasLimit, PrioritizationStrategy};
@ -27,6 +27,7 @@ use dir::DatabaseDirectories;
use upgrade::{upgrade, upgrade_data_paths}; use upgrade::{upgrade, upgrade_data_paths};
use migration::migrate; use migration::migrate;
use ethsync::is_valid_node_url; use ethsync::is_valid_node_url;
use path;
pub fn to_duration(s: &str) -> Result<Duration, String> { pub fn to_duration(s: &str) -> Result<Duration, String> {
to_seconds(s).map(Duration::from_secs) to_seconds(s).map(Duration::from_secs)
@ -465,7 +466,7 @@ but the first password is trimmed
#[test] #[test]
#[cfg(not(windows))] #[cfg(not(windows))]
fn test_geth_ipc_path() { fn test_geth_ipc_path() {
use util::path; use path;
assert_eq!(geth_ipc_path(true), path::ethereum::with_testnet("geth.ipc").to_str().unwrap().to_owned()); assert_eq!(geth_ipc_path(true), path::ethereum::with_testnet("geth.ipc").to_str().unwrap().to_owned());
assert_eq!(geth_ipc_path(false), path::ethereum::with_default("geth.ipc").to_str().unwrap().to_owned()); assert_eq!(geth_ipc_path(false), path::ethereum::with_default("geth.ipc").to_str().unwrap().to_owned());
} }

View File

@ -61,6 +61,7 @@ extern crate parity_reactor;
extern crate parity_updater as updater; extern crate parity_updater as updater;
extern crate parity_local_store as local_store; extern crate parity_local_store as local_store;
extern crate rpc_cli; extern crate rpc_cli;
extern crate path;
#[macro_use] #[macro_use]
extern crate log as rlog; extern crate log as rlog;

View File

@ -33,7 +33,7 @@ use ethsync::{ManageNetwork, SyncProvider};
use hash_fetch::fetch::Client as FetchClient; use hash_fetch::fetch::Client as FetchClient;
use jsonrpc_core::{MetaIoHandler}; use jsonrpc_core::{MetaIoHandler};
use updater::Updater; use updater::Updater;
use util::RotatingLogger; use ethcore_logger::RotatingLogger;
#[derive(Debug, PartialEq, Clone, Eq, Hash)] #[derive(Debug, PartialEq, Clone, Eq, Hash)]
pub enum Api { pub enum Api {

View File

@ -20,9 +20,9 @@ use ctrlc::CtrlC;
use fdlimit::raise_fd_limit; use fdlimit::raise_fd_limit;
use ethcore_rpc::{NetworkSettings, informant, is_major_importing}; use ethcore_rpc::{NetworkSettings, informant, is_major_importing};
use ethsync::NetworkConfiguration; use ethsync::NetworkConfiguration;
use util::{Colour, version, RotatingLogger, Mutex, Condvar}; use util::{Colour, version, Mutex, Condvar};
use io::{MayPanic, ForwardPanic, PanicHandler}; use io::{MayPanic, ForwardPanic, PanicHandler};
use ethcore_logger::{Config as LogConfig}; use ethcore_logger::{Config as LogConfig, RotatingLogger};
use ethcore::miner::{StratumOptions, Stratum}; use ethcore::miner::{StratumOptions, Stratum};
use ethcore::client::{Client, Mode, DatabaseCompactionProfile, VMType, BlockChainClient}; use ethcore::client::{Client, Mode, DatabaseCompactionProfile, VMType, BlockChainClient};
use ethcore::service::ClientService; use ethcore::service::ClientService;

View File

@ -29,7 +29,7 @@ use helpers::replace_home;
use io::{ForwardPanic, PanicHandler}; use io::{ForwardPanic, PanicHandler};
use jsonrpc_core::reactor::{RpcHandler, Remote}; use jsonrpc_core::reactor::{RpcHandler, Remote};
use rpc_apis; use rpc_apis;
use util::path::restrict_permissions_owner; use path::restrict_permissions_owner;
use util::H256; use util::H256;
const CODES_FILENAME: &'static str = "authcodes"; const CODES_FILENAME: &'static str = "authcodes";

View File

@ -34,6 +34,7 @@ ethsync = { path = "../sync" }
ethjson = { path = "../json" } ethjson = { path = "../json" }
ethcore-devtools = { path = "../devtools" } ethcore-devtools = { path = "../devtools" }
ethcore-light = { path = "../ethcore/light" } ethcore-light = { path = "../ethcore/light" }
ethcore-logger = { path = "../logger" }
parity-updater = { path = "../updater" } parity-updater = { path = "../updater" }
rlp = { path = "../util/rlp" } rlp = { path = "../util/rlp" }
fetch = { path = "../util/fetch" } fetch = { path = "../util/fetch" }

View File

@ -34,6 +34,7 @@ extern crate ethstore;
extern crate ethsync; extern crate ethsync;
extern crate ethash; extern crate ethash;
extern crate ethcore_light as light; extern crate ethcore_light as light;
extern crate ethcore_logger;
extern crate transient_hashmap; extern crate transient_hashmap;
extern crate jsonrpc_ipc_server as ipc; extern crate jsonrpc_ipc_server as ipc;
extern crate ethcore_ipc; extern crate ethcore_ipc;

View File

@ -19,7 +19,7 @@ use std::sync::Arc;
use std::collections::{BTreeMap, HashSet}; use std::collections::{BTreeMap, HashSet};
use futures::{future, Future, BoxFuture}; use futures::{future, Future, BoxFuture};
use util::RotatingLogger; use ethcore_logger::RotatingLogger;
use util::misc::version_data; use util::misc::version_data;
use crypto::ecies; use crypto::ecies;

View File

@ -20,7 +20,8 @@ use std::str::FromStr;
use std::collections::{BTreeMap, HashSet}; use std::collections::{BTreeMap, HashSet};
use futures::{future, Future, BoxFuture}; use futures::{future, Future, BoxFuture};
use util::{RotatingLogger, Address}; use ethcore_logger::RotatingLogger;
use util::Address;
use util::misc::version_data; use util::misc::version_data;
use crypto::ecies; use crypto::ecies;

View File

@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::sync::Arc; use std::sync::Arc;
use util::log::RotatingLogger; use ethcore_logger::RotatingLogger;
use util::Address; use util::Address;
use ethsync::ManageNetwork; use ethsync::ManageNetwork;
use ethcore::account_provider::AccountProvider; use ethcore::account_provider::AccountProvider;

View File

@ -18,7 +18,7 @@
use std::fmt; use std::fmt;
use serde::{Serialize, Serializer}; use serde::{Serialize, Serializer};
use util::log::Colour; use util::Colour;
use util::bytes::ToPretty; use util::bytes::ToPretty;
use v1::types::{U256, TransactionRequest, RichRawTransaction, H160, H256, H520, Bytes, TransactionCondition, Origin}; use v1::types::{U256, TransactionRequest, RichRawTransaction, H160, H256, H520, Bytes, TransactionCondition, Origin};

View File

@ -18,7 +18,7 @@
use v1::types::{Bytes, H160, U256, TransactionCondition}; use v1::types::{Bytes, H160, U256, TransactionCondition};
use v1::helpers; use v1::helpers;
use util::log::Colour; use util::Colour;
use std::fmt; use std::fmt;

View File

@ -24,6 +24,7 @@ semver = "0.5"
ethcore-ipc-nano = { path = "../ipc/nano" } ethcore-ipc-nano = { path = "../ipc/nano" }
futures = "0.1" futures = "0.1"
tokio-core = "0.1" tokio-core = "0.1"
ethcore-logger = { path = "../logger" }
[profile.release] [profile.release]
debug = true debug = true

View File

@ -24,6 +24,7 @@ extern crate ethcore_util as util;
extern crate ethcore_ipc as ipc; extern crate ethcore_ipc as ipc;
extern crate semver; extern crate semver;
extern crate futures; extern crate futures;
extern crate ethcore_logger;
#[cfg(test)] extern crate tokio_core; #[cfg(test)] extern crate tokio_core;
extern crate ethcore_devtools as devtools; extern crate ethcore_devtools as devtools;
@ -323,6 +324,8 @@ mod tests {
use tokio_core::io; use tokio_core::io;
use futures::{Future, future}; use futures::{Future, future};
use ethcore_logger::init_log;
pub struct VoidManager; pub struct VoidManager;
impl JobDispatcher for VoidManager { impl JobDispatcher for VoidManager {
@ -331,32 +334,6 @@ mod tests {
} }
} }
lazy_static! {
static ref LOG_DUMMY: bool = {
use log::LogLevelFilter;
use env_logger::LogBuilder;
use std::env;
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
};
}
/// Intialize log with default settings
#[cfg(test)]
fn init_log() {
let _ = *LOG_DUMMY;
}
fn dummy_request(addr: &SocketAddr, data: &str) -> Vec<u8> { fn dummy_request(addr: &SocketAddr, data: &str) -> Vec<u8> {
let mut core = Core::new().expect("Tokio Core should be created with no errors"); let mut core = Core::new().expect("Tokio Core should be created with no errors");
let mut buffer = vec![0u8; 2048]; let mut buffer = vec![0u8; 2048];

View File

@ -20,6 +20,7 @@ parity-hash-fetch = { path = "../hash-fetch" }
ipc-common-types = { path = "../ipc-common-types" } ipc-common-types = { path = "../ipc-common-types" }
ethcore-ipc = { path = "../ipc/rpc" } ethcore-ipc = { path = "../ipc/rpc" }
parity-reactor = { path = "../util/reactor" } parity-reactor = { path = "../util/reactor" }
path = { path = "../util/path" }
[profile.release] [profile.release]
debug = true debug = true

View File

@ -26,6 +26,7 @@ extern crate ethsync;
extern crate ethcore_ipc as ipc; extern crate ethcore_ipc as ipc;
extern crate target_info; extern crate target_info;
extern crate parity_reactor; extern crate parity_reactor;
extern crate path;
mod updater; mod updater;
mod operations; mod operations;

View File

@ -21,7 +21,7 @@ use std::path::{PathBuf};
use target_info::Target; use target_info::Target;
use util::misc; use util::misc;
use ipc_common_types::{VersionInfo, ReleaseTrack}; use ipc_common_types::{VersionInfo, ReleaseTrack};
use util::path::restrict_permissions_owner; use path::restrict_permissions_owner;
use util::{Address, H160, H256, Mutex, Bytes}; use util::{Address, H160, H256, Mutex, Bytes};
use ethsync::{SyncProvider}; use ethsync::{SyncProvider};
use ethcore::client::{BlockId, BlockChainClient, ChainNotify}; use ethcore::client::{BlockId, BlockChainClient, ChainNotify};

View File

@ -11,11 +11,9 @@ build = "build.rs"
log = "0.3" log = "0.3"
env_logger = "0.3" env_logger = "0.3"
rustc-serialize = "0.3" rustc-serialize = "0.3"
arrayvec = "0.3"
rand = "0.3.12" rand = "0.3.12"
time = "0.1.34" time = "0.1.34"
rocksdb = { git = "https://github.com/ethcore/rust-rocksdb" } rocksdb = { git = "https://github.com/ethcore/rust-rocksdb" }
lazy_static = "0.2"
eth-secp256k1 = { git = "https://github.com/ethcore/rust-secp256k1" } eth-secp256k1 = { git = "https://github.com/ethcore/rust-secp256k1" }
rust-crypto = "0.2.34" rust-crypto = "0.2.34"
elastic-array = { git = "https://github.com/ethcore/elastic-array" } elastic-array = { git = "https://github.com/ethcore/elastic-array" }
@ -32,11 +30,12 @@ ethcore-bigint = { path = "bigint" }
parking_lot = "0.3" parking_lot = "0.3"
using_queue = { path = "using_queue" } using_queue = { path = "using_queue" }
table = { path = "table" } table = { path = "table" }
ansi_term = "0.7" ansi_term = "0.9"
tiny-keccak= "1.0" tiny-keccak= "1.0"
ethcore-bloom-journal = { path = "bloom" } ethcore-bloom-journal = { path = "bloom" }
regex = "0.1" regex = "0.1"
lru-cache = "0.1.0" lru-cache = "0.1.0"
ethcore-logger = { path = "../logger" }
[features] [features]
default = [] default = []

View File

@ -19,7 +19,7 @@ clippy = { version = "0.0.103", optional = true}
igd = "0.5.0" igd = "0.5.0"
libc = "0.2.7" libc = "0.2.7"
parking_lot = "0.3" parking_lot = "0.3"
ansi_term = "0.7" ansi_term = "0.9"
rustc-serialize = "0.3" rustc-serialize = "0.3"
ethcore-io = { path = "../io" } ethcore-io = { path = "../io" }
ethcore-util = { path = ".." } ethcore-util = { path = ".." }
@ -27,6 +27,8 @@ ethcore-devtools = { path = "../../devtools" }
ethkey = { path = "../../ethkey" } ethkey = { path = "../../ethkey" }
ethcrypto = { path = "../../ethcrypto" } ethcrypto = { path = "../../ethcrypto" }
rlp = { path = "../rlp" } rlp = { path = "../rlp" }
path = { path = "../path" }
ethcore-logger = { path ="../../logger" }
[features] [features]
default = [] default = []

View File

@ -40,7 +40,7 @@ use node_table::*;
use stats::NetworkStats; use stats::NetworkStats;
use discovery::{Discovery, TableUpdates, NodeEntry}; use discovery::{Discovery, TableUpdates, NodeEntry};
use ip_utils::{map_external_address, select_public_address}; use ip_utils::{map_external_address, select_public_address};
use util::path::restrict_permissions_owner; use path::restrict_permissions_owner;
use parking_lot::{Mutex, RwLock}; use parking_lot::{Mutex, RwLock};
type Slab<T> = ::slab::Slab<T, usize>; type Slab<T> = ::slab::Slab<T, usize>;

View File

@ -71,6 +71,8 @@ extern crate ethkey;
extern crate ethcrypto as crypto; extern crate ethcrypto as crypto;
extern crate rlp; extern crate rlp;
extern crate bytes; extern crate bytes;
extern crate path;
extern crate ethcore_logger;
#[macro_use] #[macro_use]
extern crate log; extern crate log;

View File

@ -98,7 +98,7 @@ fn net_service() {
#[test] #[test]
fn net_connect() { fn net_connect() {
::util::log::init_log(); ::ethcore_logger::init_log();
let key1 = Random.generate().unwrap(); let key1 = Random.generate().unwrap();
let mut config1 = NetworkConfiguration::new_local(); let mut config1 = NetworkConfiguration::new_local();
config1.use_secret = Some(key1.secret().clone()); config1.use_secret = Some(key1.secret().clone());

6
util/path/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "path"
version = "0.1.0"
authors = ["debris <marek.kotewicz@gmail.com>"]
[dependencies]

View File

@ -553,7 +553,7 @@ mod tests {
use hashdb::{HashDB, DBValue}; use hashdb::{HashDB, DBValue};
use super::*; use super::*;
use super::super::traits::JournalDB; use super::super::traits::JournalDB;
use log::init_log; use ethcore_logger::init_log;
use kvdb::{DatabaseConfig}; use kvdb::{DatabaseConfig};
#[test] #[test]

View File

@ -456,7 +456,7 @@ mod tests {
use common::*; use common::*;
use super::*; use super::*;
use hashdb::{HashDB, DBValue}; use hashdb::{HashDB, DBValue};
use log::init_log; use ethcore_logger::init_log;
use journaldb::JournalDB; use journaldb::JournalDB;
use kvdb::Database; use kvdb::Database;

View File

@ -93,7 +93,6 @@ extern crate rocksdb;
extern crate env_logger; extern crate env_logger;
extern crate crypto as rcrypto; extern crate crypto as rcrypto;
extern crate secp256k1; extern crate secp256k1;
extern crate arrayvec;
extern crate elastic_array; extern crate elastic_array;
extern crate time; extern crate time;
extern crate ethcore_devtools as devtools; extern crate ethcore_devtools as devtools;
@ -108,9 +107,8 @@ extern crate regex;
extern crate lru_cache; extern crate lru_cache;
extern crate heapsize; extern crate heapsize;
extern crate itertools; extern crate itertools;
extern crate ethcore_logger;
#[macro_use]
extern crate lazy_static;
#[macro_use] #[macro_use]
extern crate log as rlog; extern crate log as rlog;
@ -137,8 +135,6 @@ pub mod trie;
pub mod nibbleslice; pub mod nibbleslice;
pub mod nibblevec; pub mod nibblevec;
pub mod semantic_version; pub mod semantic_version;
pub mod log;
pub mod path;
pub mod snappy; pub mod snappy;
pub mod cache; pub mod cache;
mod timer; mod timer;
@ -153,9 +149,9 @@ pub use triehash::*;
pub use trie::{Trie, TrieMut, TrieDB, TrieDBMut, TrieFactory, TrieError, SecTrieDB, SecTrieDBMut}; pub use trie::{Trie, TrieMut, TrieDB, TrieDBMut, TrieFactory, TrieError, SecTrieDB, SecTrieDBMut};
pub use nibbleslice::*; pub use nibbleslice::*;
pub use semantic_version::*; pub use semantic_version::*;
pub use log::*;
pub use kvdb::*; pub use kvdb::*;
pub use timer::*; pub use timer::*;
pub use ansi_term::{Colour, Style};
/// 160-bit integer representing account address /// 160-bit integer representing account address
pub type Address = H160; pub type Address = H160;

View File

@ -958,7 +958,7 @@ mod tests {
#[test] #[test]
fn playpen() { fn playpen() {
::log::init_log(); ::ethcore_logger::init_log();
let mut seed = H256::new(); let mut seed = H256::new();
for test_i in 0..10 { for test_i in 0..10 {