Skip to content

Releases: odygrd/quill

v2.3.3

18 Nov 01:56
Compare
Choose a tag to compare

Fixes

  • Previously when multiple threads were loggin, Quill backend logging thread would first try reading the log messages of
    one thread until the queue was completely empty before reading the log messages of the next thread.
    When one of the threads was logging a lot, it could result in only displaying the log of that thread, hiding the
    logs of the other threads. This has now been fixed and all log messages from all threads are read fairly.

v2.3.2

27 Oct 15:44
6a03657
Compare
Choose a tag to compare

Fixes

  • Fix code not compiling with treat warnings as errors set on Windows. (#198)

v2.3.1

27 Oct 09:37
6486802
Compare
Choose a tag to compare

Fixes

  • Optimise logging queue cache alignment of variables. It seems that v2.3.0 made the hot path slower by ~5 ns per message. This has been fixed in this version and the performance is now the same as in the previous versions.

v2.3.0

26 Oct 21:00
0f268ba
Compare
Choose a tag to compare

Improvements

  • Cache the available bytes for reading in the logging queue. This is meant to offer some minor performance
    improvement to the backend logging thread. #185

  • Fixed static code analysis and clang '-Wdocumentation' warnings.

  • The Handler.h API has changed in this version to support structured logs. If you have implemented your own custom
    Handler you will have to change it to follow the new API.

  • This version adds support for writing structured logs. Structured logs provide easier search through events.
    Structured logging is automatically enabled when named arguments are provided to the format string. Structured logs
    are only supported by the new quill::JsonFileHandler handler. The already existing FileHandler and
    ConsoleHandler are compatible with named arguments, but they will ignore them and output the log in its
    original format, as defined by the pattern formatter.
    Structured logs are not supported for wide characters at the moment.
    See example_json_structured_log.cpp

For example :

  quill::start();

  quill::Handler* json_handler =
    quill::create_handler<quill::JsonFileHandler>("json_output.log", "w");

  // create another logger tha logs e.g. to stdout and to the json file at the same time
  quill::Logger* logger = quill::create_logger("dual_logger", {quill::stdout_handler(), json_handler});
  for (int i = 2; i < 4; ++i)
  {
    LOG_INFO(logger, "{method} to {endpoint} took {elapsed} ms", "POST", "http://", 10 * i);
  }
  1. Will write to stdout (stdout_handler) :
23:37:19.850432433 [11811] example_json_structured_log.cpp:39 LOG_INFO      dual_logger  - POST to http:// took 20 ms
23:37:19.850440154 [11811] example_json_structured_log.cpp:39 LOG_INFO      dual_logger  - POST to http:// took 30 ms
  1. Will produce a JSON file (json_handler) :
{ "timestamp": "23:37:19.850432433", "file": "example_json_structured_log.cpp", "line": "39", "thread_id": "11811", "logger": "dual_logger", "level": "Info", "message": "{method} to {endpoint} took {elapsed} ms", "method": "POST", "endpoint": "http://", "elapsed": "20" }
{ "timestamp": "23:37:19.850440154", "file": "example_json_structured_log.cpp", "line": "39", "thread_id": "11811", "logger": "dual_logger", "level": "Info", "message": "{method} to {endpoint} took {elapsed} ms", "method": "POST", "endpoint": "http://", "elapsed": "30" }

v2.2.0

23 Sep 13:10
Compare
Choose a tag to compare

v2.2.0

Improvements

  • Previously storing the default root logger by calling quill::get_logger() followed by quill::configure(cfg)
    would invalidate the pointer to the default root logger returned by the former function. This has now been fixed and
    the obtained Logger* pointer is still valid.
  • Disable fmt::streamed(). (#189)
  • Update bundled fmt to 9.1.0
  • logger->should_log(level) is removed. A compile time check was added to logger->should_log<level>()
    . (#187)

v2.1.0

08 Jul 22:26
0179e6e
Compare
Choose a tag to compare

This version includes breaking changes to the API. Those changes are related to how quill is configured, before calling quill::start() to start the backend thread.

Check the updated examples.

Config.h - contains runtime configuration options

TweakMe.h - contains compile time configuration

For example quill::set_default_logger_handler(...) has been removed. To set a default filehandler :

  // create a handler
  quill::Handler* file_handler = quill::file_handler("test.log", "w");

  file_handler->set_pattern(
    "%(ascii_time) [%(thread)] %(fileline:<28) %(level_name) %(logger_name:<12) - %(message)",
    "%Y-%m-%d %H:%M:%S.%Qms", quill::Timezone::GmtTime);

  // set the handler as the default handler for any newly created logger in the config
  quill::Config cfg;
  cfg.default_handlers.emplace_back(file_handler);

  // configure must always be called prior to `start()`
  quill::configure(cfg);
  quill::start();
  • Removed some API functions from Quill.h that were previously used for configuration. Instead, quill::Config object has to be created. For example quill::config::set_backend_thread_cpu_affinity(1); has been removed and instead the following code is needed :
  quill::Config cfg;
  cfg.backend_thread_cpu_affinity = 1;
  quill::configure(cfg);
  • QUILL_CHRONO_CLOCK has been moved from TweakMe.h to Config.h. It is now possible to switch between rdtsc and system clocks without re-compiling.
    See example_trivial_system_clock.cpp
  • QUILL_RDTSC_RESYNC_INTERVAL has been moved from TweakMe.h to Config.h.
  • It is now possible to log user timestamps rather than the system's. This feature is useful for time simulations.
    See example_custom_clock.cpp
    and example_custom_clock_advanced.cpp
  • Previously the logger names were limited to a maximum of 22 characters. This limitation has been removed.
  • Added support for gcc 7.5.0. (#178)
  • Updated bundled fmt to 9.0.0

v2.0.2

31 May 23:38
b259b7f
Compare
Choose a tag to compare

Fixes

  • Fix crash when a std::string containing null-terminated characters is passed to the logger. (#176)

v2.0.1

21 May 16:33
Compare
Choose a tag to compare

Improvements

  • Add a flag to RotatingFileHandler to disable removing the old files when w mode is used.

v2.0.0

18 May 22:22
Compare
Choose a tag to compare

From version v2 and onwards only c++17 is supported.

This version is a major refactor.

Fixes

  • RotatingFileHandler will now correctly rotate the files when append mode is used (#123)

Improvements

  • Reduced and simplified codebase.
  • Improved backend worker thread performance.
  • QUILL_DUAL_QUEUE_MODE has been removed. A single queue now handles every case.
  • QUILL_STRING has been removed. That macro is no longer required when passing a format string to the
    PatternFormatter.

Differences

  • v1.7 compiles with c++14, v2 only compiles for c++17.
  • v1.7 on Windows supports wide character logging, v2 has limited wide character support such as logging wchar_t, std::wstring, std::wstring_view. For example, logging std::vector<std::wstring> is not supported.
  • v1.7 on Windows requires the filepath used for the handlers as a wide strings, v2 supports only filenames as narrow strings.

v1.7.3

15 May 22:30
9b6fbce
Compare
Choose a tag to compare
  • Fix crash on windows when a long wstring (>500 chars) is logged (#173)
  • Fix compiler error when trying to compile with -DQUILL_DISABLE_NON_PREFIXED_MACROS (#174)
  • Fix a compile warning in clang (#175)