Skip to content

Version 1.6.0

Compare
Choose a tag to compare
@gabime gabime released this 15 May 13:18
· 989 commits to v1.x since this release
83b9149

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);

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 with yay` pacakge manage for archlinux. Thanks @zyansheep (#1494).