As an open-source project, gabime/spdlite has picked up 14 stars on GitHub (C++). Minimal, header-only C++ logging library. Lite version of spdlog.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
A small, header-only C++20 logger - the lite version of spdlog, simpler, smaller, fewer features.
Use spdlite if you want a tiny, fast, capable logger.
Install
Copy the include/spdlite/ folder into your build tree - header-only, no build step.
Or via CMake (find_package, FetchContent, or add_subdirectory), link spdlite::spdlite.
See include/spdlite/logger.h for the full API and include/spdlite/sinks/ for the available sinks.
Thread safety
logger_mt is thread-safe - it uses a std::mutex to serialize format and dispatch
per call, so multiple threads can write through the same instance safely.
If you don't require thread safety, you can use logger_st which skips the lock entirely:
spdlite::logger_mt<console_sink> log; // std::mutex
spdlite::logger_st<console_sink> log_st; // no locking
Both share the same API; only the mutex type differs.
Passing loggers around
Every logger derives from spdlite::logger, so code that receives one doesn't need to know
its sinks or mutex type:
Fractional digits: none, ms (3), us (6), or ns (9).
Compile-time level gating
Strip log calls below a chosen severity from the binary entirely - via the SPDLITE_* macros:
#define SPDLITE_ACTIVE_LEVEL SPDLITE_LEVEL_INFO // before the include
#include "spdlite/logger.h"
void hot_path(spdlite::logger& log) {
SPDLITE_DEBUG(log, "value={}", expensive_to_compute()); // gone - args not evaluated
SPDLITE_INFO(log, "did the thing"); // stays
}
Macros: SPDLITE_TRACE, SPDLITE_DEBUG, SPDLITE_INFO, SPDLITE_WARN, SPDLITE_ERROR,
SPDLITE_CRITICAL. Levels: SPDLITE_LEVEL_TRACE (0) ... SPDLITE_LEVEL_OFF (6). Per-TU
setting; default is SPDLITE_LEVEL_TRACE (no elision). The compile-time gate is independent
of the runtime set_log_level() - a call emits only when both gates pass.
Compile times
Most of a logging TU's compile cost is the bundled fmt headers. To cut it:
Gate out cold log calls - see Compile-time level gating above; elided calls cost nothing,
at compile time and runtime.
Compile fmt once - -DSPDLITE_COMPILED_FMT=ON builds fmt's implementation into a small
static lib instead of header-only, so logging TUs compile much faster (~60% per TU) with no
runtime cost and identical output. Worth it from ~2 logging TUs up; gives up pure header-only
(consumers link the lib - automatic via spdlite::spdlite).
Use std::format - -DSPDLITE_USE_STD_FORMAT=ON drops the bundled fmt headers and compiles
~20% faster per TU, but it is a compile-time-for-runtime trade: libstdc++'s std::format is
~1.3-2× slower than bundled fmt on typical messages, so fmt stays the default. Needs a modern
stdlib (libstdc++ 13+, libc++ 17+, MSVC 19.29+).
Build options
CMake isn't required to use spdlite - copy the headers and you're done. The flags below
only apply if you build the bundled example, tests, or benchmarks with the provided
CMakeLists.txt.
Option
Default
Effect
SPDLITE_BUILD_EXAMPLE
ON
Build the example executable.
SPDLITE_BUILD_TESTS
OFF
Build the doctest-based unit tests.
SPDLITE_BUILD_BENCH
OFF
Build the benchmarks (fetches Google Benchmark automatically).
SPDLITE_USE_STD_FORMAT
OFF
CMake option: use <format> instead of bundled fmt - drop fmt/ from the install. Pass via -DSPDLITE_USE_STD_FORMAT=ON.
SPDLITE_COMPILED_FMT
OFF
Compile bundled fmt once into a static lib (not header-only) - faster builds, links spdlite_fmt. Mutually exclusive with SPDLITE_USE_STD_FORMAT.
The most recent commit recorded on gabime/spdlite was 1 month ago, based on the GitHub push timestamp. The repository has 1 forks — one of the better signals of community interest.
How many stars does gabime/spdlite have?
gabime/spdlite has 14 GitHub stars — refresh the page for the live number, or check github.com/gabime/spdlite. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is gabime/spdlite open source?
Yes — gabime/spdlite ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/gabime/spdlite.
What is gabime/spdlite?
gabime/spdlite (gabime/spdlite) is a C++ project on GitHub. From the project's own README: Minimal, header-only C++ logging library. Lite version of spdlog.
What language is gabime/spdlite written in?
gabime/spdlite is written primarily in C++. GitHub's language field is based on the largest share of bytes in the default branch.
What license does gabime/spdlite use?
gabime/spdlite is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about gabime/spdlite?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/gabime/spdlite is the definitive source.
Read full README in the tab above.
Want a second opinion on spdlite?
Ask an AI that can read this page — one click and you get its take on spdlite.