Struct log_listener::Decorator
source · pub(crate) struct Decorator {
pub(crate) mode: DecoratorMode,
pub(crate) is_active: bool,
pub(crate) log_levels: HashMap<i32, &'static str>,
pub(crate) lines: HashMap<String, &'static str>,
pub(crate) regex_str_color: String,
pub(crate) re_color: Option<Regex>,
pub(crate) regex_grp_color: Vec<RegexGroup>,
pub(crate) color_components: bool,
}
Fields§
§mode: DecoratorMode
§is_active: bool
§log_levels: HashMap<i32, &'static str>
§lines: HashMap<String, &'static str>
§regex_str_color: String
§re_color: Option<Regex>
§regex_grp_color: Vec<RegexGroup>
§color_components: bool
Implementations§
source§impl Decorator
impl Decorator
pub fn new(mode: DecoratorMode) -> Self
pub(crate) fn fail_if_active(&self)
pub fn add_line(&mut self, keyword: String, color: &'static str)
pub fn add_word(&mut self, keyword_regex: String, color: &'static str)
pub fn add_log_level(&mut self, level: LogLevelFilter, color: &'static str)
pub fn init_regex(&mut self)
pub fn activate(&mut self)
sourcepub(crate) fn try_colorize_line(
&self,
line: String,
keyword: &str,
color: &&'static str
) -> (String, bool)
pub(crate) fn try_colorize_line( &self, line: String, keyword: &str, color: &&'static str ) -> (String, bool)
If line contains a keyword, color the entire line