Skip to content

Releases: odygrd/quill

v3.3.1

31 Jul 14:10
Compare
Choose a tag to compare
  • Fixed RotatingFileHandler to prevent accidental removal of non-log files when using open mode w
    and set_remove_old_files(true)

v3.3.0

29 Jul 09:36
Compare
Choose a tag to compare
  • Added a quill::get_handler(handler_name) function that allows easy lookup of an existing Handler by name. This
    function proves helpful when you want to retrieve a handler and pass it to a new logger.

  • Fix build failure of Intel Compiler Classic. (#332)

  • Introduced QUILL_BLOCKING_QUEUE_RETRY_INTERVAL_NS option for user-configurable retry interval in the blocking queue.
    Default value is 800 nanoseconds. (#330)

  • Improved backend thread handling. Now verifies that all producer SPSC queues are empty before entering sleep.

  • Fixed a race condition and potential crash in quill::remove_logger(Logger*) when called without prior quill::flush().

  • Added protection to prevent removal of the root logger with quill::remove_logger(Logger*).

  • Improved exception handling on the backend thread when calling fmt::format().

    While compile-time checks ensure that the format string and arguments match, runtime errors can still occur.
    Previously, such exceptions would affect and drop subsequent log records. Now, exceptions are caught and logged
    in the log file and reported via the backend thread notification handler (default is cerr).

    For example, if a dynamic precision is used (LOG_INFO(logger, "Support for floats {:.{}f}", 1.23456, 3.321312)),
    the log file will show the following error message:

    LOG_INFO root [format: "Support for floats {:.{}f}", error: "precision is not integer"]
    

    Additionally, an error message will be printed to cerr

    Quill ERROR: [format: "Support for floats {:.{}f}", error: "precision is not integer"]
    
  • Fixed a bug in timestamp formatting that occasionally displayed an hour component of 0 as
    24. (#329)

  • Added support for specifying a runtime log level, allowing dynamic log level configuration at runtime.
    The new runtime log level feature provides flexibility when needed, with a minor overhead cost.
    It is recommended to continue using the existing static log level macros for optimal
    performance. (#321)

    For example

      std::array<quill::LogLevel, 4> const runtime_log_levels = {quill::LogLevel::Debug,
                                                                 quill::LogLevel::Info,
                                                                 quill::LogLevel::Warning,
                                                                 quill::LogLevel::Error};
    
      for (auto const& log_level : runtime_log_levels)
      {
        LOG_DYNAMIC(logger, log_level, "Runtime {} {}", "log", "level");
      }
  • Added support for printf-style formatting with _CFORMAT macros. These macros use the printf format string syntax,
    simplifying the migration of legacy codebases using printf statements.

    For example

      std::array<uint32_t, 4> arr = {1, 2, 3, 4};
      LOG_INFO(logger, "This is a log info example using fmt format {}", arr);
      
      LOG_INFO_CFORMAT(logger, "printf style %s supported %d %f", "also", 5, 2.32);
  • Added a metadata() member function to the TransitEvent class. It provides access to the Metadata object
    associated with the log record, simplifying syntax for retrieving log record metadata in custom Handlers.

    For example

    void CustomHandler::write(fmt_buffer_t const& formatted_log_message, quill::TransitEvent const& log_event)
    {
      MacroMetadata const macro_metadata = log_event.metadata();
    }
  • Simplified file handler configuration. Now, instead of passing multiple arguments to the constructor,
    you only need to provide a single FileHandlerConfig object. This change makes creating file handlers objects
    much easier and more flexible.

    For example

    quill::FileHandlerConfig file_handler_cfg;
    file_handler_cfg.set_open_mode('w');
    file_handler_cfg.set_append_to_filename(quill::FilenameAppend::StartDateTime);
    
    std::shared_ptr<quill::Handler> file_handler = quill::file_handler("application.log", file_handler_cfg);
    quill::Logger* logger_foo = quill::create_logger("my_logger", std::move(file_handler));
    
    LOG_INFO(my_logger, "Hello from {}", "application");
  • Combined the functionalities of RotatingFileHandler (rotating based on file size) and TimeRotatingFileHandler
    (rotating on a time interval) into a single, more versatile RotatingFileHandler. Users can now conveniently rotate
    logs based on both file size and time intervals simultaneously. The updated RotatingFileHandler offers a variety of
    customization options for improved flexibility. For more information on available configurations,
    refer to the RotatingFileHandlerConfig documentation.

    For example

      // Create a rotating file handler which rotates daily at 18:30 or when the file size reaches 2GB
    std::shared_ptr<quill::Handler> file_handler =
      quill::rotating_file_handler(filename,
                                   []()
                                   {
                                     quill::RotatingFileHandlerConfig cfg;
                                     cfg.set_rotation_time_daily("18:30");
                                     cfg.set_rotation_max_file_size(2'000'000'000);
                                     return cfg;
                                   }());
    
    // Create a logger using this handler
    quill::Logger* logger_bar = quill::create_logger("daily_logger", std::move(file_handler));
  • Improved compatibility with older versions of external libfmt. Quill now compiles for all versions
    of libfmt >= 8.0.0.

v2.0.3

24 Jul 21:44
Compare
Choose a tag to compare

This is an older release with the timestamp formatting fix #329 for a specific user.
Please do not use this release and use the latest versions instead

v3.2.0

10 Jul 00:07
Compare
Choose a tag to compare
  • Addition of std::is_trivially_copyable<T> to default copy loggable types. (#318)
  • By default, the static library now builds with -fPIC to generate position-independent code.
    To disable this feature, you can use the CMake option QUILL_DISABLE_POSITION_INDEPENDENT_CODE.
  • The LOG_<LEVEL>_LIMIT macros now support using std::chrono duration types for specifying the log interval.
    Instead of providing a raw number, you can use:
    LOG_INFO_LIMIT(std::chrono::milliseconds {100} , quill::get_logger(), "log message");

v3.1.0

30 Jun 15:26
c580d49
Compare
Choose a tag to compare
  • It is now possible to set a minimum logging interval for specific logs. For example:
  for (uint64_t i = 0; i < 10; ++i)
  {
    LOG_INFO_LIMIT(2000, default_logger, "log in a loop with limit 1 message every 2000 micros for i {}", i);
    std::this_thread::sleep_for(std::chrono::microseconds{1000});
  }
  • quill::utility::to_string() now uses fmt::to_string()

  • Quill now utilizes a custom namespace (fmtquill) for the bundled fmt library. This enables smooth integration with
    your own external fmt library, even if it's a different version.

v3.0.2

16 Jun 11:03
Compare
Choose a tag to compare
  • Add missing header on clang when QUILL_X86ARCH is defined.

v3.0.1

15 Jun 22:32
Compare
Choose a tag to compare
  • Enhanced the reported message for reallocation of the unbounded queue to include the thread id.

v3.0.0

15 Jun 14:40
1fdb3e7
Compare
Choose a tag to compare
  • The previous unbounded queue constantly reallocated memory, risking system memory exhaustion, especially when handling intensive logging from multiple threads. Starting from v3.0.0, the default behavior has been improved to limit the queue capacity to 2 GB. When this limit is reached, the queue blocks the hot thread instead of further reallocation. To modify the default behavior, there is no need to recompile the quill library. Recompile your application with one of the following header-only flags.
# Previous behavior in v2.*.*: Reallocates new queues indefinitely when max capacity is reached
-DCMAKE_CXX_FLAGS:STRING="-DQUILL_USE_UNBOUNDED_NO_MAX_LIMIT_QUEUE"

# Default behavior in v3.*.*: Starts small, reallocates up to 2GB, then hot thread blocks
-DCMAKE_CXX_FLAGS:STRING="-DQUILL_USE_UNBOUNDED_BLOCKING_QUEUE"

# Starts small, reallocates up to 2GB, then hot thread drops log messages
-DCMAKE_CXX_FLAGS:STRING="-DQUILL_USE_UNBOUNDED_DROPPING_QUEUE"

# Fixed queue size, no reallocations, hot thread drops log messages
-DCMAKE_CXX_FLAGS:STRING="-DQUILL_USE_BOUNDED_QUEUE"         

# Fixed queue size, no reallocations, hot thread blocks
-DCMAKE_CXX_FLAGS:STRING="-DQUILL_USE_BOUNDED_BLOCKING_QUEUE"
  • Added support for huge pages on Linux. Enabling this feature allows bounded or unbounded queues to utilize huge pages,
    resulting in optimized memory allocation.
  quill::Config cfg;
  cfg.enable_huge_pages_hot_path = true;
  
  quill::configure(cfg);
  quill::start();
  • Added support for logging std::optional, which is also now supported in libfmt v10.0.0.
  LOG_INFO(default_logger, "some optionals [{}, {}]", std::optional<std::string>{},
           std::optional<std::string>{"hello"});
  • Introduced a new function run_loop in the Handler base class, which allows users to override and execute periodic tasks. This enhancement provides users with the flexibility to perform various actions at regular intervals, such as batch committing data to a database.
  • In scenarios where a hot thread is blocked and unable to push messages to the queue in blocking mode, this situation will now be reported through the backend_thread_notifications_handler to the standard error stream cerr.

v2.9.2

04 Jun 20:06
525b0e0
Compare
Choose a tag to compare
  • Fix increased compile times due to x86intrin headers. (#298)
  • Fix compile error when using QUILL_X86ARCH on windows.
  • Fix bugs when quill is build as a shared library on windows. (#302)

v2.9.1

28 May 23:28
Compare
Choose a tag to compare
  • Removed CMAKE_INSTALL_RPATH from cmake. (#284)
  • Fix compile warning on Apple M1. (#291)
  • Update bundled libfmt to v10.0.0
  • Fix for CMAKE_MODULE_PATH (#295)
  • Fixed a bug in TimeRotatingFileHandler when quill::FilenameAppend::None is used. (#296)
  • Fixed TimeRotatingFileHandler and RotatingFileHandler to work when /dev/null is used as a filename (#297)
  • Added NullHandler that can be used to discard the logs. For example:
int main()
{
  quill::start();
  
  std::shared_ptr<quill::Handler> file_handler =
    quill::null_handler();

  quill::Logger* logger_bar = quill::create_logger("nullhandler", std::move(file_handler));

  for (uint32_t i = 0; i < 150; ++i)
  {
    LOG_INFO(logger_bar, "Hello");
  }