1
0
Mirror von https://github.com/tkuschel/bees.git synchronisiert 2026-05-08 04:59:37 +02:00

tracer: annotate both ends of the stack trace

Add a matching "--- BEGIN TRACE..." line to complement the "---  END
TRACE..." line.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
Dieser Commit ist enthalten in:
Zygo Blaxell
2021-06-02 00:13:48 -04:00
Ursprung b083003cf7
Commit 1fd26a03b2
2 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
+6
Datei anzeigen
@@ -42,11 +42,16 @@ do_cmd_help(char *argv[])
// tracing ----------------------------------------
thread_local BeesTracer *BeesTracer::tl_next_tracer = nullptr;
thread_local bool BeesTracer::tl_first = true;
thread_local bool BeesTracer::tl_silent = false;
BeesTracer::~BeesTracer()
{
if (!tl_silent && current_exception()) {
if (tl_first) {
BEESLOGNOTICE("--- BEGIN TRACE --- exception ---");
tl_first = false;
}
try {
m_func();
} catch (exception &e) {
@@ -61,6 +66,7 @@ BeesTracer::~BeesTracer()
tl_next_tracer = m_next_tracer;
if (!m_next_tracer) {
tl_silent = false;
tl_first = true;
}
}
+1
Datei anzeigen
@@ -197,6 +197,7 @@ class BeesTracer {
thread_local static BeesTracer *tl_next_tracer;
thread_local static bool tl_silent;
thread_local static bool tl_first;
public:
BeesTracer(function<void()> f, bool silent = false);
~BeesTracer();