From c6491eef27e45000625c31c5e5b5910eef208836 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 20 Aug 2026 16:54:00 +0100 Subject: [PATCH] fix(telemetry): log without JLOG in the beast insight collector JLOG is defined in xrpl/basics/Log.h, and libxrpl.beast cannot include xrpl.basics -- basics depends on beast, not the reverse. Use the journal stream idiom the rest of the file already uses. --- src/libxrpl/beast/insight/OTelCollector.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/libxrpl/beast/insight/OTelCollector.cpp b/src/libxrpl/beast/insight/OTelCollector.cpp index c74b1738a3..1488bfb32e 100644 --- a/src/libxrpl/beast/insight/OTelCollector.cpp +++ b/src/libxrpl/beast/insight/OTelCollector.cpp @@ -929,14 +929,20 @@ OTelCollectorImp::onCollectionReady() } catch (std::exception const& e) { - JLOG(journal_.error()) << "OTelCollector: could not register an observable gauge, " - "so that metric will not be exported: " - << e.what(); + if (auto stream = journal_.error()) + { + stream << "OTelCollector: could not register an observable gauge, so that " + "metric will not be exported: " + << e.what(); + } } } - JLOG(journal_.info()) << "OTelCollector: registered " << armed << " of " << gauges.size() - << " observable gauges"; + if (auto stream = journal_.info()) + { + stream << "OTelCollector: registered " << armed << " of " << gauges.size() + << " observable gauges"; + } } void @@ -953,7 +959,8 @@ OTelCollectorImp::onCollectionStopping() for (auto* gauge : gauges) gauge->disarm(); - JLOG(journal_.info()) << "OTelCollector: stopped observing " << gauges.size() << " gauges"; + if (auto stream = journal_.info()) + stream << "OTelCollector: stopped observing " << gauges.size() << " gauges"; } opentelemetry::nostd::shared_ptr const&