ORE Studio 0.0.4
Loading...
Searching...
No Matches
List of all members
skip_telemetry_guard Class Reference

RAII guard that marks log records to be skipped by telemetry sinks. More...

#include <skip_telemetry_guard.hpp>

Inheritance diagram for skip_telemetry_guard:
Inheritance graph
Collaboration diagram for skip_telemetry_guard:
Collaboration graph

Additional Inherited Members

- Public Types inherited from scoped_attribute
using iterator = boost::log::attribute_set::iterator
 
- Public Member Functions inherited from scoped_attribute
 scoped_attribute (const std::string &attribute_name)
 Constructs a scoped attribute guard.
 
 scoped_attribute (const scoped_attribute &)=delete
 
scoped_attributeoperator= (const scoped_attribute &)=delete
 
 scoped_attribute (scoped_attribute &&other) noexcept
 
scoped_attributeoperator= (scoped_attribute &&other) noexcept
 

Detailed Description

RAII guard that marks log records to be skipped by telemetry sinks.

Use this guard in any code that is part of the telemetry pipeline to prevent recursive logging. When logs are created while this guard is active, they will still be processed by console and file sinks, but telemetry sinks will skip them.

The guard affects all log records created on the same thread, including records from nested function calls.

Example usage:

void telemetry_repository::create(const telemetry_log_entry& entry) {
BOOST_LOG_SEV(lg(), trace) << "Creating entry..."; // Skipped by telemetry sinks
// ... database operations that may log ...
}
RAII guard that marks log records to be skipped by telemetry sinks.
Definition skip_telemetry_guard.hpp:58