Debugging Tools
Beyond the governor and crash handlers, the toolkit includes three more single-header tools.
Rich-style logging (debug_log.h)
Section titled “Rich-style logging (debug_log.h)”Beautiful terminal logging inspired by Python’s Rich library:
- Colored log levels — INFO (cyan), WARN (yellow), ERROR (red)
- Box-drawing characters — visual section boundaries with Unicode
- Automatic timing — sections show elapsed time on completion
- Correlation IDs — track related log entries across threads
- Multiple formats — Rich (colored), Text (plain), JSON (machine-parseable)
Use Windows Terminal or a terminal with VT/ANSI support for full color output.
Minidump generation (minidump.h)
Section titled “Minidump generation (minidump.h)”Automatic crash dump capture:
- Full memory dumps for post-mortem debugging
- Configurable dump location
- Automatic cleanup of old dumps
Minidumps can be loaded in Visual Studio or WinDbg for detailed analysis.
Build information (build_info.h)
Section titled “Build information (build_info.h)”Captures comprehensive build and system info:
| Category | What it captures |
|---|---|
| Toolkit | Version string |
| Git | Commit hash, branch, dirty status |
| Compiler | Name and version (e.g., MSVC 1944) |
| Build | Date, time, architecture (x64/x86) |
| System | Windows version, build number |
| Hardware | CPU model, core count, total memory |
Run the included demo to see everything in action:
cd examplescl /EHsc /Zi /utf-8 test_crash.cpp /link dbghelp.lib shell32.lib
test_crash.exe 6 # Rich-style logging demotest_crash.exe 7 # Build & system info onlytest_crash.exe 1 # Trigger bad_alloc crash with full report