Skip to content

Releases: odygrd/quill

v7.3.0

29 Sep 15:18
Compare
Choose a tag to compare
  • Added the option to explicitly specify the Logger used by the built-in SignalHandler for logging errors during application crashes. (#590)
  • Prevented error logs from the SignalHandler from being output to CSV files when a CsvWriter is in use. (#588)
  • Introduced SignalHandlerOptions to simplify and unify the API. Backend::start_with_signal_handler is now deprecated, replaced by a new Backend::start overload that accepts SignalHandlerOptions for enabling signal handling.
  • Added a new create_or_get_logger overload that accepts a std::vector<std::shared_ptr<Sink>>, improving flexibility by allowing a variable number of sinks to be passed at runtime when creating a logger.
  • Added a new overload to create_or_get_logger to create a logger that inherits configuration options from a specified logger. (#596)
  • Implemented a workaround to resolve false positive warnings from clang-tidy on Windows.

v7.2.2

23 Sep 23:02
Compare
Choose a tag to compare
  • Fixed race condition during DLL unload by ensuring safe cleanup of ThreadContext when calling flush_log() (#586)

v7.2.1

22 Sep 20:30
Compare
Choose a tag to compare
  • Fixed an unused variable warning treated as an error on MSVC

v7.2.0

22 Sep 14:33
Compare
Choose a tag to compare

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"}
    

v7.1.0

09 Sep 01:43
Compare
Choose a tag to compare
  • Fixed crash when using QueueType::BoundedDropping or QueueType::UnboundedDropping after a message drops. (#553)
  • Improved performance of std::forward_list decoding.
  • Corrected reported dropped message count; previously, log flush attempts were incorrectly included.
  • Removed leftover files after running some unit tests.
  • Stabilized regression tests.
  • Suppressed false-positive -Wstringop-overflow warnings (e.g., with GCC 13).
  • Fixed MinGW build and added MinGW builds to GitHub Actions.

v7.0.0

05 Sep 22:50
Compare
Choose a tag to compare
  • Simplified the log tags API. The Tags class has been removed. You now pass a char const* directly to the macros.
    Additionally, macros previously named WITH_TAGS have been renamed to _TAGS. For example, LOG_INFO_WITH_TAGS is
    now LOG_INFO_TAGS.

  • Renamed backend_cpu_affinity to cpu_affinity in BackendOptions to improve consistency.

  • Simplified project structure by removing the extra quill directory and made minor CMake improvements; include/quill is now directly in the root.

  • Added support for std::string with custom allocator. (#524)

  • Added a new log level NOTICE, for capturing significant events that aren't errors or warnings. It fits between INFO and WARNING for logging important runtime events that require attention. (#526)

  • Enhanced static assert error message for unsupported codecs, providing clearer guidance for STL and user-defined types.

  • Improved frontend performance by caching the ThreadContext pointer in Logger class to avoid repeated function calls. On Linux, this is now further optimised with __thread for thread-local storage, while other platforms still use thread_local.

  • Minor performance enhancement in the frontend by replacing std::vector<size_t> with an InlinedVector<uint32_t, 12> for caching sizes (e.g. string arguments).

  • Fixed order of evaluation for Codec::pair<T1,T2>::compute_encoded_size() to prevent side effects observed on MSVC

  • Introduced the add_metadata_to_multi_line_logs option in PatternFormatter. This option, now enabled by default, appends metadata such as timestamps and log levels to every line of multiline log entries, ensuring consistent log output. To restore the previous behavior, set this option to false when creating a Logger using Frontend::create_or_get_logger(...). Note that this option is ignored when logging JSON using named arguments in the format message. (#534)

  • JSON sinks now automatically remove any \n characters from format messages, ensuring the emission of valid JSON messages even when \n is present in the format.

  • Replaced static variables with static constexpr in the ConsoleColours class.

  • Fixed compiler errors in a few rarely used macros. Added a comprehensive test for all macros to prevent similar issues in the future.

  • Expanded terminal list for color detection in console applications on Linux

  • Fixed an issue where char* and char[] types could be incorrectly selected by the Codec template in Array.h

  • The library no longer defines __STDC_WANT_LIB_EXT1__, as the bounds-checking functions from the extensions are no longer needed.

  • StringFromTime constructor no longer relies on the system's current time, improving performance in simulations where timestamps differ from system time. (#541)

  • The Frontend::create_or_get_logger(...) function now accepts a PatternFormatterOptions parameter, simplifying the API. This is a breaking change. To migrate quickly, wrap the existing formatting parameters in a PatternFormatterOptions object.

    Before:

      quill::Logger* logger =
        quill::Frontend::create_or_get_logger("root", std::move(file_sink),
                                              "%(time) [%(thread_id)] %(short_source_location:<28) "
                                              "LOG_%(log_level:<9) %(logger:<12) %(message)",
                                              "%H:%M:%S.%Qns", quill::Timezone::GmtTime);

    After:

      quill::Logger* logger =
        quill::Frontend::create_or_get_logger("root", std::move(file_sink), quill::PatternFormatterOptions {
                                              "%(time) [%(thread_id)] %(short_source_location:<28) "
                                              "LOG_%(log_level:<9) %(logger:<12) %(message)",
                                              "%H:%M:%S.%Qns", quill::Timezone::GmtTime});

v6.1.2

13 Aug 02:44
Compare
Choose a tag to compare
  • Fix pkg-config file on windows

v6.1.1

12 Aug 18:19
Compare
Choose a tag to compare
  • Fix pkg-config file

v6.1.0

09 Aug 19:38
3115567
Compare
Choose a tag to compare
  • Fix various compiler warnings
  • Minor serialisation improvements in Array.h and Chrono.h
  • Introduced Backend::acquire_manual_backend_worker() as an advanced feature, enabling users to manage the backend worker on a custom thread. This feature is intended for advanced use cases where greater control over threading is required. (#519)
  • Add new CsvWriter utility class for asynchronous CSV file writing. For example:
    #include "quill/Backend.h"
    #include "quill/core/FrontendOptions.h"
    #include "quill/CsvWriter.h"
    
    struct OrderCsvSchema
    {
      static constexpr char const* header = "order_id,symbol,quantity,price,side";
      static constexpr char const* format = "{},{},{},{:.2f},{}";
    };
    
    int main()
    {
      quill::BackendOptions backend_options;
      quill::Backend::start(backend_options);
      
      quill::CsvWriter<OrderCsvSchema, quill::FrontendOptions> csv_writer {"orders.csv"};
      csv_writer.append_row(13212123, "AAPL", 100, 210.32321, "BUY");
      csv_writer.append_row(132121123, "META", 300, 478.32321, "SELL");
      csv_writer.append_row(13212123, "AAPL", 120, 210.42321, "BUY");
    }

v6.0.0

27 Jul 12:56
Compare
Choose a tag to compare
  • Added a Cheat Sheet to help users get the most out of the logging library

  • Removed ArgSizeCalculator<>, Encoder<>, and Decoder<> classes. These have been consolidated into a single Codec class. Users who wish to pass user-defined objects should now specialize this single Codec class instead of managing three separate classes. For guidance, please refer to the updated advanced example

  • Added TriviallyCopyableCodec.h to facilitate serialization for trivially copyable user-defined types. For example

      struct TCStruct
      {
        int a;
        double b;
        char c[12];
        
        friend std::ostream& operator<<(std::ostream& os, TCStruct const& arg)
        {
          os << "a: " << arg.a << ", b: " << arg.b << ", c: " << arg.c;
          return os;
        }
      };
      
      template <>
      struct fmtquill::formatter<TCStruct> : fmtquill::ostream_formatter
      {
      };
      
      template <>
      struct quill::Codec<TCStruct> : quill::TriviallyCopyableTypeCodec<TCStruct>
      {
      };
      
      int main()
      {
        // init code ...
        
        TCStruct tc;
        tc.a = 123;
        tc.b = 321;
        tc.c[0] = '\0';
        LOG_INFO(logger, "{}", tc);
      }
  • Added support for passing arithmetic or enum c style arrays when std/Array.h is included. For example

      #include "quill/std/Array.h"
    
      int a[6] = {123, 456};
      LOG_INFO(logger, "a {}", a);
  • Added support for void const* formatting. For example

        int a = 123;
        int* b = &a;
        LOG_INFO(logger, "{}", fmt::ptr(b));
  • Added support for formatting std::chrono::time_point and std::chrono::duration with the inclusion
    of quill/std/Chrono.h

    #include "quill/std/Chrono.h"
    
    std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
    LOG_INFO(logger, "time is {}", now);
  • Removed unused method from ConsoleSink