diff --git a/Cargo.lock b/Cargo.lock index 9e3b664..dc765c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + [[package]] name = "arc-swap" version = "1.5.0" @@ -70,6 +79,19 @@ dependencies = [ "syn", ] +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -94,6 +116,12 @@ dependencies = [ "libc", ] +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "indexmap" version = "1.7.0" @@ -131,6 +159,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + [[package]] name = "os_str_bytes" version = "2.4.0" @@ -179,6 +213,23 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + [[package]] name = "strsim" version = "0.10.0" @@ -281,6 +332,7 @@ name = "vhost-device-i2c" version = "0.1.0" dependencies = [ "clap", + "env_logger", "libc", "log", "thiserror", diff --git a/coverage_config_x86_64.json b/coverage_config_x86_64.json index 861b91e..661c0d3 100644 --- a/coverage_config_x86_64.json +++ b/coverage_config_x86_64.json @@ -1,5 +1,5 @@ { - "coverage_score": 74.1, + "coverage_score": 73.9, "exclude_path": "", "crate_features": "" } diff --git a/i2c/Cargo.toml b/i2c/Cargo.toml index 4340251..37ccf46 100644 --- a/i2c/Cargo.toml +++ b/i2c/Cargo.toml @@ -13,6 +13,7 @@ edition = "2018" [dependencies] clap = { version = "=3.0.0-beta.2", features = ["yaml"] } +env_logger = ">=0.9" libc = ">=0.2.95" log = ">=0.4.6" thiserror = "1.0" diff --git a/i2c/src/main.rs b/i2c/src/main.rs index d565158..1dd6b3f 100644 --- a/i2c/src/main.rs +++ b/i2c/src/main.rs @@ -233,6 +233,8 @@ fn start_backend(config: I2cConfiguration) } fn main() -> Result<()> { + env_logger::init(); + let yaml = load_yaml!("cli.yaml"); let cmd_args = App::from(yaml).get_matches();