|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | DBGLOG_SIZE 65535 |
| Size of the debug log buffer in bytes (64KB) | |
Functions | |
| void | dbgLogEnable (int level) |
| void | dbgLogDisable () |
Variables | |
| char * | dbgLog |
Circular memory buffer that captures recent log messages for crash dump analysis.
The debug log is a fixed 64KB circular buffer registered as a log destination that automatically includes itself in crash dumps. This allows crash analyzers to see the last ~64KB of log output leading up to a crash, providing critical context for debugging.
Key features:
DBGLOG_SIZE)dbgLog) for debugger accessTypical workflow:
The buffer uses the compact log format from Memory Buffer Logging and is visible to both debuggers (via dbgLog pointer) and crash dump tools.
| void dbgLogDisable | ( | ) |
Disable debug log buffer and unregister from logging system
Unregisters the debug log destination, removes the buffer from crash dumps, and frees the buffer memory. Sets dbgLog to NULL. Safe to call when already disabled (no-op).
| void dbgLogEnable | ( | int | level | ) |
Enable debug log buffer and register with logging system
| level | Maximum log level to capture (e.g., LOG_Verbose, LOG_Debug, LOG_Info) |
Allocates a 64KB circular buffer, registers it as a log destination, and includes it in crash dumps. If debug logging is already enabled, disables it first before re-enabling with the new level.
All log messages at or below the specified level (from all non-private categories) will be written to the buffer in addition to other destinations.
|
extern |
Pointer to debug log buffer (NULL when disabled)
Global pointer to the circular log buffer. Visible to debuggers and automatically included in crash dumps when enabled. Points to NULL when debug logging is not active.