Cli: Introduce --detailed-log-output flag (#10278)

* Cli: Introduce `--detailed-log-output` flag

If this CLI flag is given, detailed log output will be enabled. This includes the log level, log
target ad the thread name. Before this was only enabled when a log level higher than `info` should
be logged.

* Update client/tracing/src/logging/mod.rs

Co-authored-by: David <dvdplm@gmail.com>

Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
Bastian Köcher
2021-11-16 14:01:35 +01:00
committed by GitHub
parent 363dbbe8da
commit 12cf771a7a
3 changed files with 59 additions and 17 deletions
@@ -49,6 +49,14 @@ pub struct SharedParams {
#[structopt(short = "l", long, value_name = "LOG_PATTERN")]
pub log: Vec<String>,
/// Enable detailed log output.
///
/// This includes displaying the log target, log level and thread name.
///
/// This is automatically enabled when something is logged with any higher level than `info`.
#[structopt(long)]
pub detailed_log_output: bool,
/// Disable log color output.
#[structopt(long)]
pub disable_log_color: bool,
@@ -107,6 +115,11 @@ impl SharedParams {
&self.log
}
/// Should the detailed log output be enabled.
pub fn detailed_log_output(&self) -> bool {
self.detailed_log_output
}
/// Should the log color output be disabled?
pub fn disable_log_color(&self) -> bool {
self.disable_log_color