A header-only, thread-safe logging library for C++20.
-
Logging
- Component-tagged
volk::log::Loggerwithstd::formatstyle calls - Trace, debug, info, warning, and error levels with a global level filter
- Entries stamped with time, thread ID, level, and component
- Component-tagged
-
Sinks
- Logs to
stderrby default - File sink by path
- Custom sinks through a callback
- Logs to
-
Crash reporting
- Unhandled SEH exception logging, including access violation addresses (Windows)
- Callable wrapper that logs uncaught exceptions on worker threads
VolkLog is header-only. Add it as a submodule and put external\VolkLog\include in your project's Additional Include Directories:
#include <VolkLog/log.hh>
static constexpr volk::log::Logger logger{ "OVERLAY" };
int main() {
volk::log::set_level(volk::log::Level::Info);
volk::log::set_sink("app.log");
volk::log::install_crash_handler();
logger.info("Window created ({}x{})", 2560, 1440);
}Output:
[14:02:31.512] [1234] [INFO ] [OVERLAY] Window created (2560x1440)
- Creator: lyk64
This project is licensed under the MIT License - see the LICENSE file for details.