Format Messages#
formatter
allows users to customize the style of the messages being logged. Fields are mapped by named arguments and users can specify detailed format for each field.
auto writer = make_async_stdout_writer();
writer->set_formatter(
formatter::builder()
// Custom format pattern
.set_pattern("{TIME:%FT%TZ} {LV:} >> {MSG:} << {FUNC:}{FILE:}{LINE:}{COL:}")
// Show full path of source file
.set_file_name_style(file_name_style::full_path)
// Show log level with colors
.set_color_level_style());
Argument Name |
Type |
Source |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|