A lightweight, thread-safe logging utility for C++ that supports colored console output, timestamped log entries, and structured file logging.
$ git clone https://github.com/ddj4747/Debug-Log.git
$ cd Debug-Log
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .- Thread-safe logging using
std::mutexandstd::lock_guard - Supports
const char*andstd::stringinput - Console output with color (using
fmt) - File output:
- All logs stored in
logs/all/ - Warnings and errors also stored in
logs/errors/
- All logs stored in
- Log entries are timestamped
- fmt for formatted and colored console output
- boost stacktrace for debug stacktrace inside console
- utfcpp for UTF-8 validation and invalid-sequence replacement
Debug::Log("This is a standard log message.");
Debug::LogWarning("This is a warning.");
Debug::LogError("This is an error message.");
// You can also pass std::string:
std::string message = "Log message";
Debug::Log(message);
int playerScore = 128;
Debug::Log("Player score: {}", playerScore);$ [LOG 2025-06-24_12-34-56] This is a standard log message.
$ [WARNING 2025-06-24_12-34-56] This is a warning.
$ [ERROR 2025-06-24_12-34-56] This is an error message.
$ [LOG 2025-06-24_12-34-56] Log message
$ [LOG 2025-06-24_12-34-56] Player score: 128