Skip to content

v7.2.0

Compare
Choose a tag to compare
@odygrd odygrd released this 22 Sep 14:33
· 41 commits to master since this release

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 map LOG_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 log std::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 and std::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 of TransitEvent, introducing support for custom buffer sizes in file streams and tuning transit_events_soft_limit and transit_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 and RotatingFileSink. Buffer size is now configurable via FileSinkConfig::set_write_buffer_size(size_value) with a default of 64 KB.
  • Added an optional fsync interval to control the minimum time between consecutive fsync calls, reducing disk wear from frequent fsync operations. This option is only applicable when fsync is enabled. (#557)
  • Implemented support for appending a custom timestamp format to log filenames via StartCustomTimestampFormat.
    Example usage:
    auto 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;
    }());
    This will create a log file named logfile0919.log, where 0919 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):
    LOG_INFO(hybrid_logger, "Operation {name} completed with code {code}", "Update", 123, "Data synced successfully");
    This will output:
    Operation Update completed with code 123
    
    And the corresponding JSON will be:
    {"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"}