refactor: disable color in reports in json format (#2509)

This commit is contained in:
Chethan Rao
2023-10-09 18:51:09 +05:30
committed by GitHub
parent 8b50997e56
commit aa176c7c5d
3 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,7 @@ pub fn setup(
subscriber.with(logging_layer).init();
}
config::LogFormat::Json => {
error_stack::Report::set_color_mode(error_stack::fmt::ColorMode::None);
let logging_layer =
FormattingLayer::new(service_name, console_writer).with_filter(console_filter);
subscriber.with(logging_layer).init();