[go: up one dir, main page]

default_format

Function default_format 

Source
pub fn default_format(
    style: &(impl CologStyle + ?Sized),
    buf: &mut Formatter,
    record: &Record<'_>,
) -> Result<(), Error>
Expand description

Default implementation for CologStyle::format

§Returns

Inject [style.line_separator] prefix at newlines, and format result according to [style.prefix_token].

(this is the default colog style)

§Errors

Returns std::io::Error on write error.

Examples found in repository?
examples/custom-stateful-logger.rs (line 39)
37    fn format(&self, buf: &mut Formatter, record: &Record<'_>) -> Result<(), Error> {
38        *self.line.lock().unwrap() += 1;
39        colog::format::default_format(self, buf, record)
40    }