Navigate:
spdlog
~$SPDLO0.2%

spdlog: C++ logging library with multiple sinks

Fast C++ logging with flexible sinks and fmt formatting.

LIVE RANKINGS • 02:15 PM • STEADY
OVERALL
#201
24
DEVELOPER TOOLS
#35
30 DAY RANKING TREND
ovr#201
·Devel#35
STARS
28.3K
FORKS
5.0K
7D STARS
+53
7D FORKS
+6
See Repo:
Share:

Learn more about spdlog

spdlog::info("Hello, {}!", "World"); spdlog::error("Error code: {}", 404);

spdlog

1

Dual deployment modes

Available as header-only for simple integration or as a compiled library to reduce compilation overhead. Users can choose based on their project's build requirements and compilation time constraints.

2

Multiple log targets

Supports routing to rotating files, daily files, console with color output, syslog, Windows event log, debugger output, and custom sinks. This allows flexible log management without changing application code.

3

Runtime and compile-time configuration

Log levels and patterns can be modified at runtime, while compile-time macros like SPDLOG_ACTIVE_LEVEL allow removing logging calls entirely from release builds. Supports both single and multi-threaded logger instances.


#include "spdlog/spdlog.h"

int main() {
    spdlog::info("Application started");
    spdlog::warn("Low disk space: {}%", 15);
    spdlog::error("Failed to connect to database");
    spdlog::debug("User ID: {}, Action: {}", 1234, "login");
    return 0;
}

vv1.17.0

Version 1.17.0

  • Bump bundled {fmt} library to 12.1.0
  • Fix the `%z` formatter (UTC offset):
  • Windows: Replaced implementation for better accuracy and speed (~2.5x) by @gabime in
  • FreeBSD: Fixed incorrect implementation (#3483) by @gabime in
  • Fixed issue where the offset was not displaying as `+00:00` when the formatter was configured to show UTC time.
vv1.16.0

version 1.16.0

  • Bump bundled {fmt} library to 12.0.0
  • Use std::getenv #3414 by @kfeng123 in
  • Remove unnecessary and inconsistent "final" from color sinks by @vadz in
  • Fix ringbuffer sink for zero buffer size by @gabime in
  • Add option to override CMAKEDEBUGPOSTFIX by @joshuachp in
vv1.15.3

Version 1.15.3

  • Bumped bundled {fmt} library to 11.2.0 by @gabime in #3399
  • Fixed incorrect behavior in `dupfiltersink` when reporting skipped messages by @SleepingSoul in #3390
  • Fixed MSVC C4530 warning when exceptions are disabled by @roeas in #3393
  • Added support for modifying `max-size` and `max-files` in `rotatingfilesink` after creation by @gabime in #3397
  • Added `spdlog::registerorreplace(new_logger)` to safely replace existing loggers in the registry by @gabime in #3398


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers