gabime / spdlogC++ · header-only or compiled
============================================================================================================================================================================================================================

// spdlog
// Fast C++ logging library.

Log it.
Then get out of the way.

spdlog is a fast C++ logging library. The whole point is that writing a line costs almost nothing, so nobody has to decide whether this code path deserves logging.

> C++ > Fast > Logging > Library
stdoutillustrative output
[2026-08-04 06:00:11.204] [ingest] [info] worker pool started, 8 threads
[2026-08-04 06:00:11.207] [ingest] [debug] queue depth 0, backpressure off
[2026-08-04 06:00:11.891] [parser] [trace] frame 41208 decoded
[2026-08-04 06:00:12.004] [parser] [warn] unexpected field order, falling back to slow path
[2026-08-04 06:00:12.010] [sink] [error] rotate failed: destination is read only
[2026-08-04 06:00:12.011] [sink] [info] switched to fallback sink, no lines dropped
Output above is illustrative. Levels, named loggers, and sinks are the real shape of the library.

Cheap enough to leave in

A logging call you can afford in a hot loop is the difference between having the record and guessing afterward.

Named loggers

Separate loggers per subsystem keep the stream readable when three components write at once.

Sinks are swappable

Console today, rotating file tomorrow, both at once when an incident makes you want them.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gabime/spdlogDesign study by Goose. Not affiliated with the project.