v1.6.0
版本发布时间: 2020-05-15 21:18:24
gabime/spdlog最新发布版本:v1.14.1(2024-04-30 20:34:26)
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, 3b732783482568081fd3e274ce2e793a89aded92, 5b3a18319e1759a6244ef1e80ab22f71f4811ab1).
-
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, 0b36d4e360ad89b30bf9c57d208542a0486cc587). 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, 64de8807e269cc5d562bdcf981ee8f5de7bd6168). 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 ofmap
to find color codes (695912c7cf1b3ce59401f73bd7b18a666a77cda6, 4b7c05903b99718accbb4eaa93b25a0686307479). 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 likehexdump
. 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 (ca9c83f824270a7ee1d183f29faa01262f810fd6, 76389e057fca1ea158d79785f668808a088d5d3a, 7766bc25d116e5d14de1e95dfb548f6e2e0c3680, d38bd138cd5f12b3c6fbd2d70506fff54fb39962)
-
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, 348c4380d695ee9d177360ce8804e4468bf0902f). 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 02802af97f9552ce511896a112bab0ab1ffbe99a, 644073300243261a2605c36d7c79692f0fcddf0d, 1f7f1c1ffb60c8a58fe0523f8cf0c96932904aef) -
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).