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 <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-03-12 13:03:13 +00:00
parent 7192a374a8
commit 5dcf366f8f

View File

@@ -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;