spdlog v1.4.0 Release Notes

Release Date: 2019-09-21 // over 4 years ago
  • πŸ‘Œ 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 -DCMAKE_BUILD_TYPE=shared 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