From 8f2ca706c21fef0cdc22f218e95164a9266aa0f9 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 29 Dec 2018 12:04:35 +0100 Subject: [PATCH] Setup env_logger --- Cargo.lock | 14 ++++++++++++++ Cargo.toml | 1 + src/lib.rs | 1 + 3 files changed, 16 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 92b8b06bc9b2..73547919e8af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,6 +216,18 @@ dependencies = [ "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "env_logger" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "errno" version = "0.2.4" @@ -532,6 +544,7 @@ dependencies = [ "cranelift-faerie 0.26.0 (git+https://github.com/CraneStation/cranelift.git)", "cranelift-module 0.26.0 (git+https://github.com/CraneStation/cranelift.git)", "cranelift-simplejit 0.26.0 (git+https://github.com/CraneStation/cranelift.git)", + "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "faerie 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -805,6 +818,7 @@ dependencies = [ "checksum cranelift-native 0.26.0 (git+https://github.com/CraneStation/cranelift.git)" = "" "checksum cranelift-simplejit 0.26.0 (git+https://github.com/CraneStation/cranelift.git)" = "" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" +"checksum env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e" "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" "checksum faerie 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f869e12bcad2b4ff6ac60e01c2354957312fbf0c10dc938f340d58932b3db52" diff --git a/Cargo.toml b/Cargo.toml index 7266c9b85d8b..1a8797c0c6ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ bitflags = "1.0.3" byteorder = "1.2.6" libc = "0.2.45" tempfile = "3.0.4" +env_logger = "0.6" # Uncomment to use local checkout of cranelift #[patch."https://github.com/CraneStation/cranelift.git"] diff --git a/src/lib.rs b/src/lib.rs index 8cbd597fd59b..c1ac678d70ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -184,6 +184,7 @@ impl CodegenBackend for CraneliftCodegenBackend { tcx: TyCtxt<'a, 'tcx, 'tcx>, _rx: mpsc::Receiver>, ) -> Box { + env_logger::init(); if !tcx.sess.crate_types.get().contains(&CrateType::Executable) && std::env::var("SHOULD_RUN").is_ok() {