From 9c01c0dcb5308d8d50ddf2d3fad6599fbff7d3dd Mon Sep 17 00:00:00 2001 From: Alexander Ekdahl Date: Fri, 29 Nov 2019 19:20:48 -0500 Subject: Use env_logger in ra_cli --- Cargo.lock | 22 +++++++++++++++++++++- crates/ra_cli/Cargo.toml | 7 ++++++- crates/ra_cli/src/main.rs | 3 +-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2557b5e59..d418f2d96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -323,6 +323,15 @@ name = "encode_unicode" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "filetime" version = "0.2.8" @@ -453,6 +462,14 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "idna" version = "0.2.0" @@ -928,7 +945,8 @@ dependencies = [ name = "ra_cli" version = "0.1.0" dependencies = [ - "flexi_logger 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pico-args 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ra_batch 0.1.0", "ra_db 0.1.0", @@ -1843,6 +1861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum ena 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8944dc8fa28ce4a38f778bd46bf7d923fe73eed5a439398507246c8e017e6f36" "checksum encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" "checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum flexi_logger 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a13ea6b8a4debecf47bf3966d56db0e21366bc3a3649ba159e1a9e6fdd36a4f4" @@ -1860,6 +1879,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" "checksum inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40b54539f3910d6f84fbf9a643efd6e3aa6e4f001426c0329576128255994718" diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml index c7e0d0f0f..9718b4b54 100644 --- a/crates/ra_cli/Cargo.toml +++ b/crates/ra_cli/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] pico-args = "0.3.0" -flexi_logger = "0.14.0" +log = "0.4" ra_syntax = { path = "../ra_syntax" } ra_ide = { path = "../ra_ide" } @@ -19,3 +19,8 @@ ra_db = { path = "../ra_db" } path = "../ra_prof" # features = [ "cpu_profiler" ] # features = [ "jemalloc" ] + +[dependencies.env_logger] +version = "0.7.1" +default-features = false +features = ["humantime"] diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index fe847e611..3808590ab 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -7,7 +7,6 @@ mod progress_report; use std::{error::Error, fmt::Write, io::Read}; -use flexi_logger::Logger; use pico_args::Arguments; use ra_ide::{file_structure, Analysis}; use ra_prof::profile; @@ -32,7 +31,7 @@ impl Verbosity { } fn main() -> Result<()> { - Logger::with_env_or_str("error").start()?; + env_logger::try_init()?; let subcommand = match std::env::args_os().nth(1) { None => { -- cgit v1.2.3