|
| STATUS_ADD_DEFINITIONS (debugStatusDefinitions) |
|
void | debug_filter_add (const wchar_t *tag) |
| debug output is very useful, but "too much of a good thing can kill you". More...
|
|
void | debug_filter_remove (const wchar_t *tag) |
| in future, discard output with the given tag. More...
|
|
void | debug_filter_clear () |
| clear all filter state; equivalent to debug_filter_remove for each tag that was debug_filter_add-ed. More...
|
|
bool | debug_filter_allows (const wchar_t *text) |
| indicate if the given text would be printed. More...
|
|
void | debug_printf (const wchar_t *fmt,...) |
| write a formatted string to the debug channel, subject to filtering (see below). More...
|
|
Status | debug_WriteCrashlog (const wchar_t *text) |
| write an error description and all logs into crashlog.txt (in unicode format). More...
|
|
void | debug_FreeErrorMessage (ErrorMessageMem *emm) |
| free memory from the error message. More...
|
|
const wchar_t * | debug_BuildErrorMessage (const wchar_t *description, const wchar_t *filename, int line, const char *func, void *context, const wchar_t *lastFuncToSkip, ErrorMessageMem *emm) |
| build a string describing the given error. More...
|
|
void | debug_DisplayMessage (const wchar_t *caption, const wchar_t *msg) |
| translates and displays the given strings in a dialog. More...
|
|
static bool | ShouldSuppressError (atomic_bool *suppress) |
|
static ErrorReactionInternal | CallDisplayError (const wchar_t *text, size_t flags) |
|
static ErrorReaction | PerformErrorReaction (ErrorReactionInternal er, size_t flags, atomic_bool *suppress) |
|
ErrorReaction | debug_DisplayError (const wchar_t *description, size_t flags, void *context, const wchar_t *lastFuncToSkip, const wchar_t *pathname, int line, const char *func, atomic_bool *suppress) |
| display an error dialog with a message and stack trace. More...
|
|
void | debug_SkipErrors (Status err) |
| suppress (prevent from showing) the error dialog from subsequent debug_OnError for the given Status. More...
|
|
size_t | debug_StopSkippingErrors () |
|
static bool | ShouldSkipError (Status err) |
|
ErrorReaction | debug_OnError (Status err, atomic_bool *suppress, const wchar_t *file, int line, const char *func) |
| called when a DEBUG_WARN_ERR indicates an error occurred; notifies the user via debug_DisplayError. More...
|
|
ErrorReaction | debug_OnAssertionFailure (const wchar_t *expr, atomic_bool *suppress, const wchar_t *file, int line, const char *func) |
| called when a ENSURE/ASSERT fails; notifies the user via debug_DisplayError. More...
|
|
void debug_filter_add |
( |
const wchar_t * |
tag | ) |
|
debug output is very useful, but "too much of a good thing can kill you".
we don't want to require different LOGn() macros that are enabled depending on "debug level", because changing that entails lengthy compiles and it's too coarse-grained. instead, we require all strings to start with "tag_string|" (exact case and no quotes; the alphanumeric-only <tag_string> identifies output type). they are then subject to filtering: only if the tag has been "added" via debug_filter_add is the appendant string displayed.
this approach is easiest to implement and is fine because we control all logging code. LIMODS falls from consideration since it's not portable and too complex.
notes:
- filter changes only affect subsequent debug_*printf calls; output that didn't pass the filter is permanently discarded.
- strings not starting with a tag are always displayed.
- debug_filter_* can be called at any time and from the debugger, but are not reentrant.
in future, allow output with the given tag to proceed. no effect if already added.
Definition at line 77 of file debug.cpp.
void debug_SkipErrors |
( |
Status |
err | ) |
|
suppress (prevent from showing) the error dialog from subsequent debug_OnError for the given Status.
rationale: for edge cases in some functions, warnings are raised in addition to returning an error code. self-tests deliberately trigger these cases and check for the latter but shouldn't cause the former. we therefore need to squelch them.
- Parameters
-
note: only one concurrent skip request is allowed; call debug_StopSkippingErrors before the next debug_SkipErrors.
Definition at line 491 of file debug.cpp.