ORE Studio 0.0.4
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
ores::telemetry::log Namespace Reference

Implements logging for ORE Studio. More...

Classes

class  database_sink_backend
 Boost.Log sink backend that prepares logs for database storage. More...
 
class  lifecycle_manager
 Extends the base lifecycle_manager with telemetry sink support. More...
 
class  skip_telemetry_guard
 RAII guard that marks log records to be skipped by telemetry sinks. More...
 
class  telemetry_sink_backend
 Boost.Log sink backend that creates telemetry log_records. More...
 
struct  trace_context_injector
 Helper to add trace context attributes to a log record. More...
 

Typedefs

using database_log_handler = std::function< void(const domain::telemetry_log_entry &)>
 Handler function type for processing log entries destined for database storage.
 

Functions

database_log_handler make_forwarding_handler (std::function< void(const domain::telemetry_log_entry &)> handler)
 Creates a generic database log handler that simply forwards entries.
 
template<typename StreamT >
StreamT & operator<< (StreamT &strm, const trace_context_injector &injector)
 Stream operator to inject trace context into Boost.Log record.
 
template<typename RecordView >
bool should_skip_telemetry (const RecordView &rec)
 Checks if a log record should be skipped by telemetry sinks.
 

Variables

constexpr const char * skip_telemetry_attribute = "SkipTelemetry"
 Well-known attribute name used to signal telemetry sinks to skip processing a log record.
 

Detailed Description

Implements logging for ORE Studio.

Boost.Log integration for structured logging.

This namespace contains the logging infrastructure, built on top of Boost.Log with integration to the telemetry system for log correlation with distributed traces.

Contains logging infrastructure including logger factory (make_logger), lifecycle management, configuration types, and telemetry sink backend for integrating with the export system.

Typedef Documentation

◆ database_log_handler

using database_log_handler = std::function<void(const domain::telemetry_log_entry&)>

Handler function type for processing log entries destined for database storage.

The handler is called for each log entry after conversion from Boost.Log format. Implementations may store to database, cache for batch operations, or perform any other processing needed for database persistence.

Function Documentation

◆ make_forwarding_handler()

database_log_handler make_forwarding_handler ( std::function< void(const domain::telemetry_log_entry &)>  handler)

Creates a generic database log handler that simply forwards entries.

This utility function creates a handler function that can be used with the database sink backend. The actual storage mechanism is left to the caller to implement, which avoids circular dependencies with the repository.

Parameters
handlerA function that takes a telemetry_log_entry and stores it appropriately.
Returns
A handler function that can be used with the database sink backend.

◆ should_skip_telemetry()

template<typename RecordView >
bool should_skip_telemetry ( const RecordView &  rec)

Checks if a log record should be skipped by telemetry sinks.

Parameters
recThe log record to check.
Returns
true if the record has the SkipTelemetry attribute set to true.
Here is the caller graph for this function:

Variable Documentation

◆ skip_telemetry_attribute

constexpr const char* skip_telemetry_attribute = "SkipTelemetry"
constexpr

Well-known attribute name used to signal telemetry sinks to skip processing a log record.

When this attribute is present and set to true on a log record, telemetry sinks (database sink, OTLP sink, etc.) should skip processing the record to prevent recursive logging loops.