20#ifndef ORES_TELEMETRY_LOG_MACROS_HPP
21#define ORES_TELEMETRY_LOG_MACROS_HPP
23#include <boost/log/sources/record_ostream.hpp>
24#include <boost/log/attributes/constant.hpp>
25#include "ores.logging/boost_severity.hpp"
26#include "ores.telemetry/domain/telemetry_context.hpp"
46template<
typename StreamT>
48 strm << boost::log::add_value(
"trace_id",
50 strm << boost::log::add_value(
"span_id",
73#define TLOG_SEV(logger, ctx, sev) \
74 BOOST_LOG_SEV(logger, ::ores::logging::boost_severity::sev) \
75 << ::ores::logging::trace_context_injector(ctx)
Implements logging for ORE Studio.
Definition lifecycle_manager.hpp:32
StreamT & operator<<(StreamT &strm, const trace_context_injector &injector)
Stream operator to inject trace context into Boost.Log record.
Definition macros.hpp:47
std::string to_hex() const
Converts the span_id to a 16-character lowercase hex string.
Definition span_id.cpp:33
Immutable context passed through the call chain for telemetry.
Definition telemetry_context.hpp:50
const span_id & get_span_id() const
Gets the span_id from the current context.
Definition telemetry_context.cpp:56
const trace_id & get_trace_id() const
Gets the trace_id from the current context.
Definition telemetry_context.cpp:52
std::string to_hex() const
Converts the trace_id to a 32-character lowercase hex string.
Definition trace_id.cpp:33
Helper to add trace context attributes to a log record.
Definition macros.hpp:36