Skip to content

Commit aa176c7

Browse files
authored
refactor: disable color in reports in json format (#2509)
1 parent 8b50997 commit aa176c7

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/router_env/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ license.workspace = true
1010
[dependencies]
1111
cargo_metadata = "0.15.4"
1212
config = { version = "0.13.3", features = ["toml"] }
13+
error-stack = "0.3.1"
1314
gethostname = "0.4.3"
1415
once_cell = "1.18.0"
1516
opentelemetry = { version = "0.19.0", features = ["rt-tokio-current-thread", "metrics"] }

crates/router_env/src/logger/setup.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ pub fn setup(
101101
subscriber.with(logging_layer).init();
102102
}
103103
config::LogFormat::Json => {
104+
error_stack::Report::set_color_mode(error_stack::fmt::ColorMode::None);
104105
let logging_layer =
105106
FormattingLayer::new(service_name, console_writer).with_filter(console_filter);
106107
subscriber.with(logging_layer).init();

0 commit comments

Comments
 (0)