Skip to main content

lifecycle_trace

Attribute Macro lifecycle_trace 

Source
#[lifecycle_trace]
Expand description

Wraps an impl Lifecycle for T block so each lifecycle transition emits a tracing event.

Injects wrap_enter, wrap_reconcile, and wrap_exit overrides that call the user’s enter / reconcile_self / exit and emit tracing::info! on success ("entering" / "exiting") or tracing::error! on failure, with key, display_name, metadata, and error fields.

The generated code calls serde_json::to_string and the tracing macros, so both crates must be available at the call site.