Type Definition flexi_logger::FormatFunction[][src]

type FormatFunction = fn(write: &mut dyn Write, now: &mut DeferredNow, record: &Record<'_>) -> Result<(), Error>;
Expand description

Function type for format functions.

If you want to write the log lines in your own format, implement a function with this signature and provide it to one of the methods Logger::format(), Logger::format_for_files(), Logger::format_for_stdout(), or Logger::format_for_stderr().

Check out the code of the provided format functions if you want to start with a template.

Parameters

  • write: the output stream

  • now: the timestamp that you should use if you want a timestamp to appear in the log line

  • record: the log line’s content and metadata, as provided by the log crate’s macros.