Navigate:
All Reposspdlog
~$SPDLOG0.1%

spdlog: C++ logging library with multiple sinks

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

LIVE RANKINGS • 06:51 AM • STEADY
TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100TOP 100
OVERALL
#83
64
DEVELOPER TOOLS
#14
14
30 DAY RANKING TREND
ovr#83
·Devel#14
STARS
28.1K
FORKS
5.0K
DOWNLOADS
1.7K
7D STARS
+38
7D FORKS
+5
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.16.0

Bundles fmt 12.0.0; adds TCP timeouts and fixes ringbuffer zero-size crash.

  • Upgrade bundled fmt library to 12.0.0, which may introduce formatting API changes or require C++17.
  • Configure TCP sink timeouts for connect/send/recv to prevent indefinite blocking in network logging.
vv1.15.3

Maintenance release bundling fmt 11.2.0 and fixing dup_filter_sink skip-count reporting; no breaking changes noted.

  • Update to bundled fmt 11.2.0 if using the embedded version; external fmt users should verify compatibility.
  • Use new `register_or_replace()` to safely swap loggers in the registry or modify rotating_file_sink limits post-creation.
vv1.15.2

Maintenance release upgrading bundled fmt to 11.1.4 and fixing date/time format flags on POSIX and Apple platforms.

  • Upgrade picks up fmt 11.1.4; verify compatibility if you rely on bundled fmt or override it externally.
  • Fixes %D crash found by OSS-Fuzz and %z UTC offset rendering on macOS and POSIX.1-2024 systems.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers