Implement ? suffix to "quiet" a context and exclude it from backtraces (#1800)

This commit is contained in:
Rangi
2025-08-18 21:34:58 -04:00
committed by GitHub
parent 77a105e189
commit b7e0783ae7
32 changed files with 392 additions and 139 deletions

View File

@@ -6,16 +6,24 @@
#include "platform.hpp" // strcasecmp
uint64_t traceDepth = 0;
Tracing tracing;
bool trace_ParseTraceDepth(char const *arg) {
if (!strcasecmp(arg, "collapse")) {
traceDepth = TRACE_COLLAPSE;
tracing.collapse = true;
return true;
} else if (!strcasecmp(arg, "no-collapse")) {
tracing.collapse = false;
return true;
} else if (!strcasecmp(arg, "all")) {
tracing.loud = true;
return true;
} else if (!strcasecmp(arg, "no-all")) {
tracing.loud = false;
return true;
} else {
char *endptr;
tracing.depth = strtoul(arg, &endptr, 0);
return arg[0] != '\0' && *endptr == '\0';
}
char *endptr;
traceDepth = strtoul(arg, &endptr, 0);
return arg[0] != '\0' && *endptr == '\0' && traceDepth != TRACE_COLLAPSE;
}