From 5dcf366f8f7e2fced53bf04ec3360df235d9abd6 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:03:13 +0000 Subject: [PATCH] Fix codecov: exclude telemetry ifdef block in Log.cpp from coverage The trace context injection block is compiled out when XRPL_ENABLE_TELEMETRY is not defined (coverage builds). codecov still counts preprocessor-excluded lines as uncovered in the source diff. Wrap with LCOV_EXCL_START/STOP. Co-Authored-By: Claude Opus 4.6 --- src/libxrpl/basics/Log.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libxrpl/basics/Log.cpp b/src/libxrpl/basics/Log.cpp index e686effe5a..99516000ba 100644 --- a/src/libxrpl/basics/Log.cpp +++ b/src/libxrpl/basics/Log.cpp @@ -357,6 +357,7 @@ Logs::format( // Phase 8: Inject OTel trace context (trace_id, span_id) into log lines // for log-trace correlation. Only appended when an active span exists. // GetSpan() reads thread-local storage — no locks, <10ns overhead. +// LCOV_EXCL_START -- compiled out when XRPL_ENABLE_TELEMETRY is not defined #ifdef XRPL_ENABLE_TELEMETRY { auto span = @@ -377,6 +378,7 @@ Logs::format( } } #endif // XRPL_ENABLE_TELEMETRY + // LCOV_EXCL_STOP output += message;