Skip to content

v5.0.0

Compare
Choose a tag to compare
@odygrd odygrd released this 13 Jul 13:17
· 213 commits to master since this release
  • Fix build failure on Windows Arm64 (#485)

  • Previously, wide string support was included in Codec.h. Wide string functionality has now been moved to a separate header file, WideStrings.h. On Windows, logging wide strings now requires the inclusion of quill/std/WideStrings.h.

  • Added QUILL_IMMEDIATE_FLUSH preprocessor variable. This variable can be defined before including LogMacros.h or passed as a compiler flag. When QUILL_IMMEDIATE_FLUSH is defined, the library will flush the log on each log statement. This causes the caller thread to wait for the log to be processed and written to the log file by the backend thread before continuing, significantly impacting performance. This feature is useful for debugging the application when synchronized logs are required. (#488)

  • Introduced log_level_descriptions and log_level_short_codes in BackendOptions to allow customization of LogLevel descriptions and short codes, replacing previously hardcoded values. This enhancement enables users to define their own descriptions and short codes for each log level. For instance, instead of displaying LOG_WARNING, it can now be configured to show LOG_WARN. (#489)

    quill::BackendOptions backend_options;
    backend_options.log_level_descriptions[static_cast<uint32_t>(quill::LogLevel::Warning)] = "WARN";
    quill::Backend::start(backend_options);
  • Introduced LOGV_LEVEL, LOGV_LEVEL_LIMIT, and LOGV_LEVEL_WITH_TAGS macros. These new macros simplify logging by automatically printing variable names and values without explicitly specifying each variable name or using {} placeholders in the format string. Each macro can handle up to 26 arguments. The format string is concatenated at compile time, there is no runtime overhead for using these macros. For example:

      int a = 123;
      double b = 3.17;
      LOGV_INFO(logger, "A message with two variables", a, b)

    outputs A message with two variables [a: 123, b: 3.17]

  • Introduced LOGJ_LEVEL, LOGJ_LEVEL_LIMIT, and LOGJ_LEVEL_WITH_TAGS macros. These new macros simplify JSON logging by automatically embedding the name of each passed variable as a named argument in the format string. Each macro can handle up to 26 arguments. The format string is concatenated at compile time, there is no runtime overhead for using these macros. For example:

      int var_a = 123;
      std::string var_b = "test";
      LOGJ_INFO(logger, "A json message", var_a, var_b);

    outputs {"log_level":"INFO","message":"A json message {var_a}, {var_b}","var_a":"123","var_b":"test"}

  • Enhanced the filter function to also receive the formatted log_message alongside the log_statement, enabling the comparison and filtering of log_message while disregarding elements like timestamps from the full log_statement. (#493)

  • Renamed log_message to log_statement and should_log_message to should_log_statement in Logger

  • Replaced %(log_level_id) with %(log_level_short_code) in the PatternFormatter.

  • Fix a CMakeLists error for old CMake versions prior to 3.19. (#491)