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;
}Updates fmt library to 12.1.0 and significantly improves UTC offset formatter accuracy
- –Bump bundled fmt library to 12.1.0
- –Windows: Replaced implementation for better accuracy and speed (~2.5x)
- –FreeBSD: Fixed incorrect implementation
- –Fixed issue where the offset was not displaying as +00:00 when the formatter was configured to show UTC time
Updates fmt library to 12.0.0 and includes various bug fixes and build improvements
- –Bump bundled fmt library to 12.0.0
- –Use std::getenv
- –Remove unnecessary and inconsistent "final" from color sinks
- –Fix ringbuffer sink for zero buffer size
- –Add option to override CMAKEDEBUGPOSTFIX
Updates fmt library and fixes dup_filter_sink behavior with new rotating file features
- –Bumped bundled fmt library to 11.2.0
- –Fixed incorrect behavior in dupfiltersink when reporting skipped messages
- –Fixed MSVC C4530 warning when exceptions are disabled
- –Added support for modifying max-size and max-files in rotatingfilesink after creation
- –Added spdlog::registerorreplace(new_logger) to safely replace existing loggers in the registry
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
plotly.py
Interactive browser-based charts from Python with declarative API.
Floki
Elixir HTML parser with CSS selectors and multiple parser backends.
Create T3 App
Interactive CLI for scaffolding typesafe Next.js applications with the T3 Stack technology combination.
Moq
Mock .NET objects using lambda expressions and LINQ.
Cursor
Local code editor with integrated LLM assistance.