Class EventLogger

Inheritance Relationships

Derived Types

Class Documentation

class EventLogger

Handles event log record creation.

Subclassed by opentelemetry::logs::NoopEventLogger, opentelemetry::sdk::logs::EventLogger

Public Functions

virtual ~EventLogger() = default
virtual const nostd::string_view GetName() noexcept = 0
virtual nostd::shared_ptr<Logger> GetDelegateLogger() noexcept = 0
virtual void EmitEvent(nostd::string_view event_name, nostd::unique_ptr<LogRecord> &&log_record) noexcept = 0

Emit a event Log Record object

Parameters:
  • event_name – Event name

  • log_record – Log record

template<class ...ArgumentType>
inline void EmitEvent(nostd::string_view event_name, ArgumentType&&... args)

Emit a event Log Record object with arguments

Parameters:

event_name – Event name

Template Parameters:

args – Arguments which can be used to set data of log record by type. Severity -> severity, severity_text string_view -> body AttributeValue -> body SpanContext -> span_id,tace_id and trace_flags SpanId -> span_id TraceId -> tace_id TraceFlags -> trace_flags SystemTimestamp -> timestamp system_clock::time_point -> timestamp KeyValueIterable -> attributes Key value iterable container -> attributes span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)