Skip to content

Releases: gabime/spdlog

Version 1.0.0

05 Aug 00:00
Compare
Choose a tag to compare

Version 1.0.0 is a major release with numerous features and improvements.
It contains some breaking API changes that are not compatible with 0.x versions (see below).

Highlights

  • Include what you need: Reduce compilation times by including only the minimum required. Users can now to include only the actual sinks/features they need from spdlog/sinks folder.

  • Upgrade to fmt lib version 5.1 - thanks @vitaut for this great lib.

  • Support for custom formatting per sink - each sink can have it's own formatting and level using sink->set_pattern(..) or sink->set_formatter(..).

  • async logging - thread pool - async loggers now share a global thread pool by default.
    Creating and destroying async loggers is cheap now. This is in contrast to previous versions were creating async loggers was expensive, since each logger instance had its own worker thread and queue.
    The global thread pool and can be configured using spdlog::init_thread_pool(queue_size, worker_threads) or created directly using make_shared.

  • periodic flusher: spdlog::flush_every(seconds) to periodically flush all registered loggers.

  • Improved performance - by caching some recently used values in the pattern formatter.

  • Ability to add sinks to a logger after its creation (but it is not thread safe to do so - so use with caution).

Breaking changes

  • Include what you need. For example to use basic_logger add #include "spdlog/sinks/basic_file_sink.h" (see example in readme).

  • To use async loggers - include "spdlog/async.h"

  • Replaced set_async_mode(..) with factory template. For example:

 auto logger= spdlog::rotating_logger_mt<spdlog::async_factory>(...);
  • Removed printf support.

  • Removed warmup/teardown functions from async.

  • Custom sinks inheriting from sinks::base_sink need to format (if needed) the message before sending to their target. For example

void sink_it_(const details::log_msg &msg) override
{
  fmt::memory_buffer formatted;
  sink::formatter_->format(msg, formatted);
  // sink the formatted
  ...   
}
  • Added clone() virtual function to the formatter interface.

  • Removed support for #define SPDLOG_NO_REGISTRY_MUTEX

Change log

See here the complete list of changes.

Version 0.17.0

21 May 18:03
Compare
Choose a tag to compare

Summary

  • Improvements in color output impl - thanks @Qix-
  • Fixed spelling - thanks @rcarmich
  • New function to convert level_enum from string - thanks @fegomes
  • Support for custom EOL per formatter - thanks Emad William Farag
  • Make set_color public in wincolor_sink to retain configurability - thanks Benjamin Schindler
  • Fix compilation error with GCC 8 - thanks @ColinDuquesnoy
  • CMake improvements - thanks @DanielChabrowski , @grzadr and @yisonPylkita
  • Bumped bundled fmt version to 4.1.0
  • Fixed tests for older gcc compilers
  • Moved to clang source code formatter - thanks @DanielChabrowski
  • Fixed many clang-tidy warnings - thanks @DanielChabrowski
  • Fix implicit conversion warnings - thanks @tbastos
  • Added Added: g3log, log4cplus, log4cpp, p7. Changes: boost, easylogging, g2log to bench - thanks @kasru
  • Support for color formatting. using the %^ and %$ format flags.
  • Added new sink to contrib: step_logger - thanks @Puasonych
  • Replaced the lockfree queue with bounded, locked queue - this greatly improves CPU usage and memory footprint in async mode (with some cost to latency due to the mutex locking).

Version 0.16.3

12 Jan 12:39
Compare
Choose a tag to compare

Summary

  • Fix sleep issue (#609) under MSVC that happens when changing the clock backwards (pull #610) - Thanks @joaomoreno
  • Ensure that marcos always expand to expressions (pull #604) - Thanks @sam-lunt
  • Add global flush_on function (pull #605) - Thanks @sam-lunt
  • Fix conversion warning (#595, pull #596) - Thanks @Broekman

Version 0.16.2

22 Dec 17:02
Compare
Choose a tag to compare

Summary

  • Fixed a bug in extracting log files extension (#589) - Thanks @fcharlie

Version 0.16.1

20 Dec 08:29
c060a10
Compare
Choose a tag to compare

Summary

Quick fix release:

  • Fixed the version strings to 0.16.1 in spdlog.h and CMakeLists.txt
  • Fixed compiler warning in tests - Thanks @horar

Version 0.16.0

19 Dec 22:59
Compare
Choose a tag to compare

Summary

  • Rotating and daily log files keep their extension (e.g "mylog.3.txt" and not "mylog.txt.3")
  • Optional support for printf formatting (enabled using #define SPDLOG_FMT_PRINTF) - Thanks @fogo
  • Async log: increased sleep to to 500ms the worker in loop when the queue is empty
  • Fixed thread safety bug in flush() - added lock on flush in base_sink
  • Breaking change: Removed all *_if functions (trace_if, debug_if, info_if,..) because they are redundant and confusing way to preform simple if
  • Swallow only std::exceptions. report about, and re-throw other, unexpected exception types.
  • Support msvc_sink on all windows compiler (windebug-sink) - Thanks @jpcima
  • Added facilty param for syslog - Thanks @adubovikov
  • correct include path for sink/syslog_sink.h - Thanks @jpcima
  • Fix include paths - Thanks @daylanKifky
  • Some fixes in the async queue size estimation - Thanks @Subenle
  • Fixed cygwin support
  • Adding additional build environments for AppVeyor- Thanks @rkollataj
  • Fix warnings which are caused by C style cast - Thanks @knowledge4igor
  • Make short month names match in length - Thanks @berkus
  • Fix typos in code and comments - Thanks @berkus
  • Fixed missing i_formatter implementation
  • Fix SPDLOG_WCHAR_TO_UTF8_SUPPORT wchar_t logging - Thanks @hestad
  • Added formatter for unix epoch time in seconds (%E format flag) - Thanks @jasonbeach
  • Compiler-dependent line numbering in SPDLOG_TRACE - Thanks @elelel
  • Improved cmake and CMakeLists.txt - Thanks @mrpelotazo and @Lectem

Version 0.14.0

19 Aug 16:00
Compare
Choose a tag to compare

Summary

  • Upgraded the bundled fmt lib to version 4.0.0
  • Fixed crash in async logger in older gcc version 4.8.5 (268222e).
  • Fixed various sanitizer warnings.
  • Improved Android support (#422, #427).
  • Add an optional final qualifier to types (#425) for potential compiler optimisations.
  • Support for Alpine Linux (#435, #436).
  • Add wide string to utf8 string support (#442).
  • Don't use color escape codes if terminal doesn't support them bd25f59 .
  • Optional message counter feature (#445).
  • Fix OSX builds of details/os.h (#447).
  • Fix vs 2015 build error (#449).
  • UTC support (#451).
  • MinGw build fix (#456).
  • Add create_async factory functions for async loggers (#459).
  • Conditional logging implementation (#460).
  • More meaningful thread id for OSX (#463).
  • Add set_color to ansicolor_sink (#465).
  • Ability to override log level names in the log messages (#473).
  • Added TRACE_IF and DEBUG_IF macro definitions when TRACE_ON and DEBUG.
  • Fixed background color bug in windows terminal (#484).
  • Gentoo support (#502).
  • Fixed warning for missing enumeration value in tests (#488, #490).
  • Fixed numerous typos in code and comments.

Many thanks to the contributors to this release:

Version 0.13.0

27 Mar 23:40
Compare
Choose a tag to compare
  • Bumped the bundled fmt library to version 3.0.1.
  • Fixed issue #333 (unexpected appending of "txt" at the end of a log filename).
  • Fixed issue #396 (custom error handler not called in async loggers).
  • Fixed issue #403 (ambiguous warnings on some compilers).
  • Use double-braces in std::array initialisation.

Version 0.12.0

17 Feb 15:13
Compare
Choose a tag to compare

Numerous improvements and bug fixes. Many thanks to all who contributed!

  • Added %P (process Id) to format string
  • Exposed logger sinks via logger->sinks().
  • Windows native console color support.
  • Fixed vc warning on x64 build
  • Better support for for older win32 targets (WinXP/Win2003)
  • Fixed issue #300
  • Fix issue #315
  • Fix issue #317 (Build error on raspberry pi)
  • Better cmake support : list spdlog's content in IDEs
  • Fix compilation error C2664 on VS2013
  • Store thread_id in tls for better performance
  • Use the feature checking macros to detect thread_local support in clang.
  • Added option to prevent child processes from inheriting log file desciptors
  • Added SPDLOG_VERSION` macro to spdlog.h
  • Replaced static global std::string arrays by Meyer singletons for better thread safety

Support for sink levels and various bug fixes

18 Sep 01:10
Compare
Choose a tag to compare