Skip to content

Releases: odygrd/quill

v2.4.2

20 Nov 02:33
8be16cf
Compare
Choose a tag to compare

Fixes

  • Fixes an assertion that was triggered in debug mode due to changes in v2.4.1

v2.4.1

20 Nov 01:22
Compare
Choose a tag to compare
v2.4.1 Pre-release
Pre-release

Improvements

  • Previously the backend worker thread would read all the log messages from the queue but not read the log messages when
    the buffer had wrapped around. It will now read all the messages.
  • Removed the min_available_bytes cache from the SPSC queue as an optimisation. It is not needed anymore as we now
    read all messages at once instead of reading message by message.

v2.4.0

19 Nov 20:40
fb97af4
Compare
Choose a tag to compare

Improvements

  • Added a config option backend_thread_strict_log_timestamp_order. This option enables an extra timestamp
    check on the backend logging thread when each message is popped from the queues. It prevents a rare
    situation where log messages from different threads could appear in the log file in the wrong order. This flag
    is now enabled by default.

  • Added a config option backend_thread_empty_all_queues_before_exit. This option makes the backend logging thread
    to wait until all the queues are empty before exiting. This ensures no log messages are lost when the application
    exists. This flag is now enabled by default.

v2.3.4

19 Nov 01:02
39d1b55
Compare
Choose a tag to compare

Improvements

  • Optimise the backend logging thread to read multiple log messages from the same queue, but still read each
    queue from all active threads.

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