summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/util/logger.rs6
-rw-r--r--tests/integration/run_tests.rs8
2 files changed, 8 insertions, 6 deletions
diff --git a/cli/util/logger.rs b/cli/util/logger.rs
index d64e9a707..cdc89411f 100644
--- a/cli/util/logger.rs
+++ b/cli/util/logger.rs
@@ -41,8 +41,10 @@ impl log::Log for CliLogger {
pub fn init(maybe_level: Option<log::Level>) {
let log_level = maybe_level.unwrap_or(log::Level::Info);
let logger = env_logger::Builder::from_env(
- env_logger::Env::default()
- .default_filter_or(log_level.to_level_filter().to_string()),
+ env_logger::Env::new()
+ // Use `DENO_LOG` and `DENO_LOG_STYLE` instead of `RUST_` prefix
+ .filter_or("DENO_LOG", log_level.to_level_filter().to_string())
+ .write_style("DENO_LOG_STYLE"),
)
// https://github.com/denoland/deno/issues/6641
.filter_module("rustyline", log::LevelFilter::Off)
diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs
index efa2e6c85..360ff4d77 100644
--- a/tests/integration/run_tests.rs
+++ b/tests/integration/run_tests.rs
@@ -2499,8 +2499,8 @@ fn should_not_panic_on_undefined_deno_dir_and_home_environment_variables() {
}
#[test]
-fn rust_log() {
- // Without RUST_LOG the stderr is empty.
+fn deno_log() {
+ // Without DENO_LOG the stderr is empty.
let output = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
@@ -2513,12 +2513,12 @@ fn rust_log() {
assert!(output.status.success());
assert!(output.stderr.is_empty());
- // With RUST_LOG the stderr is not empty.
+ // With DENO_LOG the stderr is not empty.
let output = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
.arg("run/001_hello.js")
- .env("RUST_LOG", "debug")
+ .env("DENO_LOG", "debug")
.stderr_piped()
.spawn()
.unwrap()