mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-29 10:00:30 +00:00
fix(telemetry): replace std::format with string concat for gcc-12
libstdc++ ships <format> starting with gcc-13, so std::format in SpanGuard::span() fails to compile on gcc-12. Build the "<prefix>.<name>" span name via std::string::append instead and drop the <format> include. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <format>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@@ -177,7 +176,9 @@ SpanGuard::span(TraceCategory cat, std::string_view prefix, std::string_view nam
|
||||
auto* tel = Telemetry::getInstance();
|
||||
if ((tel == nullptr) || !tel->isEnabled() || !isCategoryEnabled(*tel, cat))
|
||||
return {};
|
||||
auto fullName = std::format("{}.{}", prefix, name);
|
||||
std::string fullName;
|
||||
fullName.reserve(prefix.size() + 1 + name.size());
|
||||
fullName.append(prefix).append(1, '.').append(name);
|
||||
return SpanGuard(std::make_unique<Impl>(tel->startSpan(fullName, categoryToSpanKind(cat))));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user