Timber v2.8.1 Timber.Context View Source
The ContextEntry module formalizes the structure of context stack entries
Most users will not interact directly with this module and will instead use
the helper functions provided by the main Timber
module. See the Timber
module for more information.
The functions in this module work by modifying the Logger metadata store which is unique to every BEAM process. This is convenient in many ways. First and foremost, it does not require you to manually manage the metadata. Second, because we conform to the standard Logger principles, you can utilize Timber alongside other Logger backends without issue. Timber prefixes its contextual metadata keys so as not to interfere with other systems.
Link to this section Summary
Functions
Takes an existing context element and inserts it into the provided context
Merges two Context structs
Removes a key from the provided context structure
Link to this section Types
Deprecated; please use element
instead
t() :: %{optional(:custom) => Timber.Contexts.CustomContext.m, optional(:http) => Timber.Contexts.HTTPContext.m, optional(:job) => Timber.Contexts.JobContext.m, optional(:organization) => Timber.Contexts.OrganizationContext.m, optional(:runtime) => Timber.Contexts.RuntimeContext.m, optional(:session) => Timber.Contexts.SessionContext.m, optional(:system) => Timber.Contexts.SystemContext.m, optional(:user) => Timber.Contexts.UserContext.m}
Link to this section Functions
Takes an existing context element and inserts it into the provided context.
Merges two Context structs
Entries in the second Context will override entries in the first. The caveat to this is custom context, which will descend into the custom context and merge it there. Even then, custom context entries in the second will override custom context entries in the first.
Removes a key from the provided context structure.