Skip to content

Version 1.4.0

Compare
Choose a tag to compare
@gabime gabime released this 21 Sep 15:37
· 1595 commits to v1.x since this release
10578ff

Improvements

  • spdlog can now be compiled as a static or shared lib (thanks @DavidZemon for the help).
    Using the compiled lib improves greatly compile times when using spdlog and is very recommended.
    $ cd spdlog && mkdir build && cd build
    # Build is static lib (pass -DSPDLOG_BUILD_SHARED=ON for building as shared lib)
    $ cmake .. && make -j
  • Upgraded to the latest and greatest fmt library version 6.0.0. Thanks @tgpfeiffer (and to @vitaut for fmt!).
  • Support for -fno-exceptions (disabled by default). Enabling this will replace all throw() statements in spdlog with std::abort(). To enable, pass -DSPDLOG_NO_EXCEPTIONS=ON to CMake before building spdlog.
  • support for building spdlog with meson. Thanks @mensinda
  • Backtrace support - store debug/trace messages in a ring buffer to display later on demand. Very useful (thanks @MathijsV for the idea):
spdlog::enable_backtrace(32); // create ring buffer with capacity of 32  messages
// or my_logger->enable_backtrace(32)..
for(int i = 0; i < 100; i++)
{
  spdlog::debug("Backtrace message {}", i); // not logged yet.. 
}
// e.g. if some error happened:
spdlog::dump_backtrace(); // log them now! show the last 32 messages
// or my_logger->dump_backtrace(32)..
  • Systemd support. Thanks @WarShoe (#1027)
  • Support for cleaning old files in daily_logger.
  • Numerous CMake build improvements. Thanks @DavidZemon , @jktjkt , @ksergey , @mnemotic , @cneumann , @dpacbach , @FrancoisChabot , @myd7349 , @matt77hias
  • Better support for various Unix BSDs (DragonFly, NetBSD, FreeBSD, OpenBSD). Thanks @jbeich (#1234)
  • Provide source location support for systemd sink. Thanks @jbelloncastro (#1122)
  • Added fmt::(w)string_view support. Thanks @matt77hias (#1139)
  • Add option to force color output without TTY . Thanks @psalz (#1175)
  • Add more overloads to spdlog::log and spdlog::logger::log. Thanks @sylveon (@1169)
  • Add public API spdlog::initialize_logger for create loggers manually. Thanks @tt4g (#1035)
  • Expose should_do_colors_ in ansicolor_sink.h. Thanks Florian Wörter (#1022)
  • Add tweak support for user short level names. Thanks @MFornander (#996)
  • Add method to filesinks to return filename. Thanks @markniebur (#978)
  • rotating_sink: Add option to rotate on open. Thanks @pwm1234 (#958)
  • Allow filename/line number at all levels. Add function name %! support. Thanks @possiblyhuman (#956)
  • New dups_filter sink -duplicate message removal sink. It will skip a message if previous one is identical and less than "max_skip_duration" old.
  • New '%o', '%i', '%u', '%O' format flags - Display elapsed time in mills/micros/nanos/seconds since previous message.
  • Some minor pattern formatter performance improvements.

Fixes