Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::TraceEvent Struct Reference

One trace event. More...

#include <diagnostics.hpp>

Public Member Functions

std::string_view category_name () const noexcept

Public Attributes

TraceCategory category
 Coarse routing label.
TracePayload payload
 Per-category payload.
std::chrono::steady_clock::time_point time
 Monotonic timestamp at publish time.
std::optional<::aria::Errorerror
 Optional Error snapshot (for *_fail / *_error events).

Detailed Description

One trace event.

Constructed inline at the publish site (typically on the stack); the sink takes a const& and is responsible for any further copy / serialise it does. Optional error lets failure events ride the same channel without forcing every event to carry a (mostly empty) Error payload.

Member Function Documentation

◆ category_name()

std::string_view aria::TraceEvent::category_name ( ) const
inlinenodiscardnoexcept

Member Data Documentation

◆ category

TraceCategory aria::TraceEvent::category

Coarse routing label.

◆ payload

TracePayload aria::TraceEvent::payload

Per-category payload.

◆ time

std::chrono::steady_clock::time_point aria::TraceEvent::time
Initial value:
=
std::chrono::steady_clock::now()

Monotonic timestamp at publish time.

Useful for event ordering; consumers that don't need it pay only one steady_clock::now() per publish (cheap on commodity CPUs).

◆ error

std::optional<::aria::Error> aria::TraceEvent::error

Optional Error snapshot (for *_fail / *_error events).

nullopt for happy-path events; populated factories carry it so consumers can route failure traces without fishing into the payload variant.


The documentation for this struct was generated from the following file: