Chronicle.Auditing.CausationManager (cratis_chronicle v0.2.0)

Copy Markdown View Source

Process-scoped causation chain manager.

Maintains a root causation entry and any additional entries added in the current process.

Summary

Functions

Adds a causation entry to the current process chain.

Clears the current process causation root and chain.

Defines the root causation entry for the calling process.

Gets the current causation chain for the calling process.

Functions

add(type, properties \\ %{})

Adds a causation entry to the current process chain.

clear()

@spec clear() :: :ok

Clears the current process causation root and chain.

define_root(properties \\ %{})

@spec define_root(map()) :: Chronicle.Auditing.CausationEntry.t()

Defines the root causation entry for the calling process.

get_current_chain()

@spec get_current_chain() :: [Chronicle.Auditing.CausationEntry.t()]

Gets the current causation chain for the calling process.