Type Definition flexi_logger::FormatFunction [−][src]
type FormatFunction = fn(write: &mut dyn Write, now: &mut DeferredNow, record: &Record<'_>) -> Result<(), Error>;
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()
,
or Logger::format_for_stderr()
.
Checkout 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.