From d54d29662f30c0fa5e1f048fdce4835e51248682 Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Fri, 23 Aug 2024 11:15:10 +0900 Subject: chore: enable `log` feature for tracing crate (#25078) This commit enables the `log` feature for the `tracing` crate. This allows us to examine additional detailed logs emitted by third party crates that use `tracing` crate for logging by setting `RUST_LOG` env var or passing `-L` option in command line. Closes #25045 --- cli/util/logger.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cli/util/logger.rs') diff --git a/cli/util/logger.rs b/cli/util/logger.rs index f3510c502..4c185f6de 100644 --- a/cli/util/logger.rs +++ b/cli/util/logger.rs @@ -46,6 +46,15 @@ pub fn init(maybe_level: Option) { // in the cli logger .filter_module("deno::lsp::performance", log::LevelFilter::Debug) .filter_module("rustls", log::LevelFilter::Off) + // swc_ecma_codegen's `srcmap!` macro emits error-level spans only on debug + // build: + // https://github.com/swc-project/swc/blob/74d6478be1eb8cdf1df096c360c159db64b64d8a/crates/swc_ecma_codegen/src/macros.rs#L112 + // We suppress them here to avoid flooding our CI logs in integration tests. + .filter_module("swc_ecma_codegen", log::LevelFilter::Off) + .filter_module("swc_ecma_transforms_optimization", log::LevelFilter::Off) + .filter_module("swc_ecma_parser", log::LevelFilter::Error) + // Suppress span lifecycle logs since they are too verbose + .filter_module("tracing::span", log::LevelFilter::Off) .format(|buf, record| { let mut target = record.target().to_string(); if let Some(line_no) = record.line() { -- cgit v1.2.3