A lightweight, header-only C++ logging library.
Easily integrate structured, leveled logging into your C++ projects with minimal setup.
- Header-only: Just include the header file and start logging.
- Log Levels: Support for multiple log levels (e.g., INFO, WARNING, ERROR, DEBUG).
- Configurable Output: Customize output format and destination (console, file, etc.).
- Simple API: Intuitive and minimalistic usage.
- No dependencies: Pure standard C++.
Minimal version needed: C++20 (for std::format support), but for 100% compatibility, C++23 is recommended.
Copy the header file (logger.hpp) from the include/ directory into your project.
Or add this repository as a submodule and include the header:
#include "include/logger.hpp"Simple example:
#include "include/logger.hpp"
int main() {
int code = 42;
Log::infoln("This is an info message!");
Log::errorf("This is an error message! {}", code);
// Add more examples as needed
}Output:
For advanced configuration, see the code comments and examples directory.
See the examples/ directory for more usage patterns.
Distributed under the MIT License. See LICENSE for more information.
Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a pull request.
