spdlog: C++ logging library with multiple sinks
Fast C++ logging with flexible sinks and fmt formatting.
Learn more about spdlog
spdlog::info("Hello, {}!", "World"); spdlog::error("Error code: {}", 404);
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.
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.
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;
}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.
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.
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.
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
tqdm
Instrument Python iterables with minimal-overhead progress tracking.
node-gyp
Compiles native C/C++ addons for Node.js.
redux-toolkit
Opinionated Redux utilities with simplified setup and Immer integration.
pybind11
Header-only library creating minimal-boilerplate C++ Python bindings.
python-dotenv
Parse and load .env files into Python environments.