]> git.hungrycats.org Git - bees/commitdiff
trace: always write the full trace log if a non-silent exception occurred
authorZygo Blaxell <bees@furryterror.org>
Sat, 30 May 2026 05:03:07 +0000 (01:03 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 5 Sep 2026 04:03:57 +0000 (00:03 -0400)
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-trace.cc

index 21ed3bcc648a56ebc59f10f0ad9e1426fcc59697..12ab5abb76259244dec3264b5a0c5ea8aef23c81 100644 (file)
@@ -28,17 +28,16 @@ BeesTracer::~BeesTracer()
                } catch (...) {
                        BEESLOG(bees_trace_level, "TRACE: Nested exception ...");
                }
-               if (!m_next_tracer) {
+       }
+       tl_next_tracer = m_next_tracer;
+       if (!m_next_tracer) {
+               if (!tl_silent && !tl_captured_traces.empty()) {
                        BEESLOG(bees_trace_level, "TRACE: --- BEGIN TRACE --- exception ---");
                        for (auto it = tl_captured_traces.rbegin(); it != tl_captured_traces.rend(); ++it) {
                                BEESLOG(bees_trace_level, "TRACE: " << *it);
                        }
                        BEESLOG(bees_trace_level, "TRACE: ---  END  TRACE --- exception ---");
-                       tl_captured_traces.clear();
                }
-       }
-       tl_next_tracer = m_next_tracer;
-       if (!m_next_tracer) {
                tl_silent = false;
                tl_captured_traces.clear();
        }