Timber v2.4.4 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

Link to this section Types

Link to this type t() View Source
t() :: %{optional(:custom) => Context.CustomContext.m, optional(:http) => Context.HTTPContext.m, optional(:job) => Context.JobContext.m, optional(:organization) => Context.OrganizationContext.m, optional(:runtime) => Context.RuntimeContext.m, optional(:session) => Context.SessionContext.m, optional(:system) => Context.SystemContext.m, optional(:user) => Context.UserContext.m}

Link to this section Functions

Link to this function add(context, context_element) View Source
add(t, context_element) :: t

Takes an existing context element and inserts it into the provided context.