torrust-tracker icon indicating copy to clipboard operation
torrust-tracker copied to clipboard

New config option for logging style

Open josecelano opened this issue 1 year ago • 0 comments

Relates to: https://github.com/torrust/torrust-tracker/issues/878#issuecomment-2155215287

After migrating from the log to the tracing crate, we can now easily support multiple formats for logging.

@da2ce7 has proposed these 4 styles:

#[derive(Debug)]
pub enum TraceStyle {
    Default,
    Pretty(bool),
    Compact,
    Json,
}

That is already included in the code, but it's hardcoded to the TraceStyle::Deafult value. It's not possible to change it from the configuration.

@da2ce7 also proposes these changes in the TOML config file:

Current:

log_level = "info"

New:

trace_filter = "info"
trace_style = "full"

trace_filter replaces log_level option in the current version.

josecelano avatar Jun 10 '24 16:06 josecelano