Add CLI argument to disable log color output (#7795)

This commit is contained in:
Bastian Köcher
2020-12-30 00:08:58 +01:00
committed by GitHub
parent acf9d2145d
commit 256871f553
4 changed files with 71 additions and 27 deletions
@@ -46,6 +46,10 @@ pub struct SharedParams {
#[structopt(short = "l", long, value_name = "LOG_PATTERN")]
pub log: Vec<String>,
/// Disable log color output.
#[structopt(long)]
pub disable_log_color: bool,
/// Disable feature to dynamically update and reload the log filter.
///
/// By default this feature is enabled, however it leads to a small performance decrease.
@@ -99,6 +103,11 @@ impl SharedParams {
&self.log
}
/// Should the log color output be disabled?
pub fn disable_log_color(&self) -> bool {
self.disable_log_color
}
/// Is log reloading disabled
pub fn is_log_filter_reloading_disabled(&self) -> bool {
self.disable_log_reloading