Chronicle. Context
(chronicle v0.1.2)
Copy Markdown
Carries audit identity and correlation data through the current process.
A context can be captured in one process and attached in another. This is
deliberately explicit: Elixir process dictionary state is not inherited by
Tasks.
context = Chronicle.Context.capture()
Task.async(fn ->
Chronicle.Context.with(context, fn ->
Chronicle.record("email.delivered", %{message_id: id})
end)
end)If the context was captured inside an Chronicle.group/3, events from the task
join that group. The group owner must await those tasks before returning.
Summary
Functions
Returns the context keys that audit options may carry.