Commit f57454cc authored by RILLING Louis's avatar RILLING Louis
Browse files

tansiv-client: Introduce feature-gated deadline_handler_debug macro

And switch from stderrlog to simple_logger
parent 8ac62889
......@@ -20,12 +20,12 @@ dependencies = [
[[package]]
name = "atty"
version = "0.2.11"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"termion",
"winapi",
]
......@@ -47,7 +47,7 @@ dependencies = [
"clang-sys",
"clap",
"env_logger",
"lazy_static 1.4.0",
"lazy_static",
"lazycell",
"log",
"peeking_take_while",
......@@ -85,7 +85,6 @@ dependencies = [
"libc",
"log",
"static_assertions",
"stderrlog",
"tansiv-client",
]
......@@ -147,6 +146,17 @@ dependencies = [
"vec_map",
]
[[package]]
name = "colored"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59"
dependencies = [
"atty",
"lazy_static",
"winapi",
]
[[package]]
name = "crossbeam-queue"
version = "0.2.2"
......@@ -162,7 +172,7 @@ version = "0.7.1"
dependencies = [
"autocfg",
"cfg-if",
"lazy_static 1.4.0",
"lazy_static",
]
[[package]]
......@@ -207,6 +217,15 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "hermit-abi"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
dependencies = [
"libc",
]
[[package]]
name = "humantime"
version = "1.3.0"
......@@ -216,12 +235,6 @@ dependencies = [
"quick-error",
]
[[package]]
name = "lazy_static"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
[[package]]
name = "lazy_static"
version = "1.4.0"
......@@ -321,12 +334,6 @@ dependencies = [
"autocfg",
]
[[package]]
name = "numtoa"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"
[[package]]
name = "peeking_take_while"
version = "0.1.2"
......@@ -381,15 +388,6 @@ version = "0.1.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
[[package]]
name = "redox_termios"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
dependencies = [
"redox_syscall",
]
[[package]]
name = "regex"
version = "1.3.9"
......@@ -399,7 +397,7 @@ dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
"thread_local 1.0.1",
"thread_local",
]
[[package]]
......@@ -425,24 +423,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
[[package]]
name = "static_assertions"
version = "0.3.4"
name = "simple_logger"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3"
[[package]]
name = "stderrlog"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32e5ee9b90a5452c570a0b0ac1c99ae9498db7e56e33d74366de7f2a7add7f25"
checksum = "cd57f17c093ead1d4a1499dc9acaafdd71240908d64775465543b8d9a9f1d198"
dependencies = [
"atty",
"chrono",
"colored",
"log",
"termcolor",
"thread_local 0.3.4",
"winapi",
]
[[package]]
name = "static_assertions"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3"
[[package]]
name = "strsim"
version = "0.8.0"
......@@ -505,14 +503,14 @@ dependencies = [
"binser_derive",
"chrono",
"crossbeam-queue",
"lazy_static 1.4.0",
"lazy_static",
"libc",
"libc_timer",
"log",
"nix",
"seq_lock",
"simple_logger",
"static_assertions",
"stderrlog",
"structopt",
]
......@@ -525,18 +523,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "termion"
version = "1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905"
dependencies = [
"libc",
"numtoa",
"redox_syscall",
"redox_termios",
]
[[package]]
name = "textwrap"
version = "0.11.0"
......@@ -546,23 +532,13 @@ dependencies = [
"unicode-width",
]
[[package]]
name = "thread_local"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
dependencies = [
"lazy_static 0.2.11",
"unreachable",
]
[[package]]
name = "thread_local"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
dependencies = [
"lazy_static 1.4.0",
"lazy_static",
]
[[package]]
......@@ -600,15 +576,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[package]]
name = "unreachable"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
dependencies = [
"void",
]
[[package]]
name = "vec_map"
version = "0.8.1"
......
......@@ -8,6 +8,7 @@ edition = "2018"
default = []
process = ["tansiv-client/process"]
qemu = ["tansiv-client/qemu"]
deadline-handler-debug = ["tansiv-client/deadline-handler-debug"]
[dependencies]
tansiv-client = {version = "0.1.0", path = "../tansiv-client"}
......@@ -17,4 +18,3 @@ static_assertions = "0.3.1"
[dev-dependencies]
tansiv-client = {version = "0.1.0", path = "../tansiv-client", features = ["test-helpers"]}
stderrlog = "0.4"
......@@ -8,7 +8,8 @@ edition = "2018"
default = []
process = []
qemu = []
test-helpers = ["stderrlog"]
deadline-handler-debug = []
test-helpers = ["simple_logger"]
[dependencies]
binser = {version = "0.1.0", path = "../../binser"}
......@@ -24,10 +25,10 @@ seq_lock = {version = "0.1.0", path = "../../seq_lock"}
static_assertions = "0.3.1"
structopt = "0.2"
stderrlog = {version = "0.4", optional = true}
simple_logger = {version = "1.11.0", optional = true}
[dev-dependencies]
stderrlog = "0.4"
simple_logger = "1.11.0"
[build-dependencies]
bindgen = "0.55.1"
macro_rules! deadline_handler_debug {
($($arg:tt)*) => {
if cfg!(feature = "deadline-handler-debug") {
::log::debug!($($arg)*)
}
}
}
......@@ -16,6 +16,8 @@ pub const MAX_PACKET_SIZE: usize = 2048;
mod buffer_pool;
mod config;
mod connector;
#[macro_use]
mod debug;
pub mod error;
mod output_msg_set;
mod timer;
......@@ -414,7 +416,7 @@ pub mod test_helpers {
pub fn init() {
// Cargo test runs all tests in a same process so don't confuse log by setting a logger
// several times.
INIT.call_once(|| stderrlog::new().module(module_path!()).verbosity(log::Level::Info as usize).init().unwrap());
INIT.call_once(|| simple_logger::SimpleLogger::from_env().init().unwrap());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment