v7.2.0
Bug Fixes:
- Fixed compile error in
BackendTscClock
(#577) - Added a missing header include in
TriviallyCopyableCodec.h
. (#560) - Fixed incorrect log level short codes introduced in v7 after adding the new log level
NOTICE
. Using%(log_level_short_code)
in the pattern formatter could incorrectly mapLOG_ERROR
to"C"
and LOG_WARNING to"E"
. (#564) - Fixed an overflow issue when logging more than
uint32_t::max()
bytes in a single log message. For example, attempting to logstd::string s(std::numeric_limits<uint32_t>::max(), 'a');
would previously cause a crash.
Improvements:
- Optimised dynamic log level handling and size calculation for fundamental types,
std::string
andstd::string_view
on the hot path. - Several enhancements to the backend worker thread, resulting in an overall 10% backend throughput increase. Key optimizations include the simplification of
TransitEventBuffer
, reducing the memory footprint ofTransitEvent
, introducing support for custom buffer sizes in file streams and tuningtransit_events_soft_limit
andtransit_events_hard_limit
default values - Improved readability of queue allocation notification messages. Capacities are now displayed in KiB, e.g.,
20:59:25 Quill INFO: Allocated a new SPSC queue with a capacity of 1024 KB (previously 512 KB) from thread 31158
.
New Features:
- Introduced support for custom buffer sizes in file streams for
FileSink
andRotatingFileSink
. Buffer size is now configurable viaFileSinkConfig::set_write_buffer_size(size_value)
with a default of 64 KB. - Added an optional
fsync
interval to control the minimum time between consecutivefsync
calls, reducing disk wear from frequent fsync operations. This option is only applicable whenfsync
is enabled. (#557) - Implemented support for appending a custom timestamp format to log filenames via
StartCustomTimestampFormat
.
Example usage:This will create a log file namedauto file_sink = quill::Frontend::create_or_get_sink<quill::FileSink>("logfile.log", []() { quill::FileSinkConfig cfg; cfg.set_filename_append_option(quill::FilenameAppendOption::StartCustomTimestampFormat, "%m%d"); return cfg; }());
logfile0919.log
, where0919
represents the month and day. - When using
%(named_args)
in the pattern formatter or logging in JSON format, extra arguments without key names are now included in JSON output with keys corresponding to their positional indexes. This allows additional details to be included in the JSON while keeping the log message clean. For example (#563):This will output:LOG_INFO(hybrid_logger, "Operation {name} completed with code {code}", "Update", 123, "Data synced successfully");
And the corresponding JSON will be:Operation Update completed with code 123
{"timestamp":"1726582319816776867","file_name":"json_file_logging.cpp","line":"71","thread_id":"25462","logger":"hybrid_logger","log_level":"INFO","message":"Operation {name} completed with code {code}","name":"Update","code":"123","_2":"Data synced successfully"}