Navigate:
spdlog
~$SPDLO0.1%

spdlog: C++ logging library with multiple sinks

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

LIVE RANKINGS • 10:20 AM • STEADY
OVERALL
#303
73
DEVELOPER TOOLS
#58
15
30 DAY RANKING TREND
ovr#303
·Devel#58
STARS
28.4K
FORKS
5.0K
7D STARS
+38
7D FORKS
+9
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

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
vv1.16.0

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
vv1.15.3

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


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers