spdlog v1.6.0 Release Notes

Release Date: 2020-05-15 // almost 4 years ago
  • What's new

    • ๐ŸŒฒ Load log levels from environment variable SPDLOG_LEVEL :

      include "spdlog/cfg/env.h"...spdlog::cfg::load_env_levels();

      $ # set log level to debug$ SPDLOG_LEVEL=debug && ./example$ # set to info except for mylogger which is set to trace:$ SPDLOG_LEVEL=info,mylogger=trace && ./example$ # turn off all logging except for mylogger which is set to debug::$ SPDLOG_LEVEL=off,mylogger=debug && ./example

    • ๐ŸŒฒ Load log levels from argv (e.g. ./example SPDLOG_LEVEL=debug):

      include "spdlog/cfg/argv.h"...spdlog::cfg::load_argv_levels(argc, argv);

    New windows eventlog sink . Thanks @ban-dana (#1418).

    ๐Ÿ†• New tcp sink that sends log messages in tcp to a remote server. Thanks @Proheeler (#1426).

    ๐Ÿ‘€ Extend spdlog with your own flags in the log pattern. See wiki for details.

    ๐Ÿ‘Œ Support for building spdlog as dll under windows. Thanks vejmartin (#1467, 3b73278, 5b3a183).

    โฌ†๏ธ Bump the bundled fmt version to 6.2.0 .

    ๐Ÿ›  Fixes and Improvements

    Prevent race condition when SPDLOG_PREVENT_CHILD_FD is defined. Thanks @dominicpoeschko (#1423).

    ๐Ÿ›  Fix race condition in the filename() function in the file sinks. Thanks @tt4g (#1430, #1431).

    Fix ansicolor_sink::set_color(..) - can cause memory violation if user provides a custom color code that points to stack memory (#1540, 0b36d4e). Thanks @caizongchao for reporting.

    ๐Ÿ›  Fix potential buffer overflow in color_sinks if creating multiple color sinks in the same logger and one of them has a pattern without color flags (#1452, 64de880). Thanks @dominicpoeschko for reporting.

    โšก๏ธ Optimize cases when string_view is passed to the logger to avoid unnecessary fmt::format. Thanks dominicpoeschko (#1424) .

    ๐Ÿ‘Œ Support for max files in daily logger - delete oldest files after creating the daily file. Thanks @ruoshui1314 (#1394).

    ๐Ÿ›  Fix deprecated warning with C++14 and external fmt lib (#1439). Thanks @ClausKlein for reporting.

    โšก๏ธ Optimize colos sinks to use std::array instead of map to find color codes (695912c, 4b7c059). Thanks @qis for the suggestion.

    ๐Ÿ›  Fix Win32 event log sink compilation. Thanks @Crunkle (#1444).

    ๐Ÿ Don't include windows.h in common.h. Thanks @ghost (#1453).

    ๐Ÿšš Resolve erroneous clang-tidy warning about using a moved from pointer. Thanks @Ruffel (#1457).

    ๐Ÿ›  Fixed numerous clang-tidy warnings.

    โž• Added options to to_hex to output hex like hexdump. Thanks @ngugcx (#1472).

    ๐Ÿ›  Fix Windows setenv check. Thanks @Crunkle (#1475).

    Removed the 'SPDLOG_NO_NAME` macro in tweakme.h and cmake.

    โž• Added a forward declaration header spdlog\fwd.h . Thanks @horenmar for the suggestion (#1481).

    ๐ŸŽ Moved throw to dedicated function to optimize compile-time and runtime-performance. Thanks @horenmar for the suggestion (#1483).

    Fix a build issue when SPDLOG_PREVENT_CHILD_FD is defined. Thanks @Naios (#1487).

    ๐Ÿ›  Fix issue with using external fmt (#1480). Thanks @nalinigans for reporting.

    ๐ŸŽ Minor performance optimizations in pattern formatter (ca9c83f, 76389e0, 7766bc2, d38bd13)

    ๐Ÿ›  Fixed on Android compilation #1527. Thanks @Bizyroth for reporting.

    โž• Add log function to the logger API to allow logging with custom timepoint. #1521 - Thanks @ron003 .

    ๐Ÿ›  Fix missing exported symbol when building spdlog.dll in windows (#1535, 348c438). Thanks @plmzod for reporting.

    โฌ‡๏ธ Dropped meson support.

    ๐Ÿ›  Fix typos and tabs in the code. Thanks @waywardmonkeys (#1536) .

    CMake: Fix GNUInstallDirs include location Thanks @vitlav (#1407).

    โ†ช CMake: workaround for Unknown extension ".c" for file issue . Thanks @niamster (#1442).

    ๐Ÿ‘ CMake: Support CPack RPM generation. Thanks @tcraigtyler (#1451).

    ๐Ÿ— CMake: Disabled extra warnings generation by default. Use SPDLOG_BUILD_WARNINGS=ON to enable again. Thanks @Glamhoth (#1503 02802af, 6440733, 1f7f1c1)

    CMake: Support for precompiled headers with SPDLOG_ENABLE_PCH flag. Thanks @OlivierLDff (#1484).

    CMake: Add /WX MSVC compiler option for only if mscv compiler is used. Thanks @trondhe (#1495).

    CMake: Set minimum version of fmt to 5.3.0. Thanks @Montellese (#1525).

    CMake: Fix tabs, whitespaces and eol. Thanks @waywardmonkeys (#1537).

    ๐Ÿšš Tests: removed duplicate entry for count_lines(). Thanks @emmenlau (#1417).

    โœ… Tests: don't run spdlog-utests and spdlog-utests-ho in parallel. Thanks @tt4g (#1421).

    โœ… Tests: Enable running the tests against an installed copy of spdlog. Thanks @mr-c (#1422).

    โœ… Tests: Support empty SPDLOG_EOL. Thanks @emmenlau (#1414).

    ๐Ÿ“ฆ README: add conda as a supported package manager . Thanks @avrahamshukron (#1473).

    ๐Ÿง README: Replace yaourt withyay` pacakge manage for archlinux. Thanks @zyansheep (#1494).