[go: up one dir, main page]

Function default_prefix_token

Source
pub fn default_prefix_token(
    style: &(impl CologStyle + ?Sized),
    level: &Level,
) -> String
Expand description

Default implementation for CologStyle::prefix_token

ยงReturns

Formats the level token ([style.level_token]) using [style.level_color], wrapped in [ and ] formatted in bold blue.

Examples found in repository?
examples/custom-stateful-logger.rs (line 33)
28    fn prefix_token(&self, level: &Level) -> String {
29        let line = format!("[Log event {:4}]", self.line.lock().unwrap());
30        format!(
31            "{} {}",
32            line.bright_white().on_blue(),
33            colog::format::default_prefix_token(self, level)
34        )
35    }