Timber v0.1.5 Timber.ContextEntry
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.
Summary
Functions
Presents the context the way it should be encoded. The log ingestion system for Timber expects contexts to be encoded such that their type is the key holding the context specific data
Creates a new context entry for a context stack
Types
context_data :: Timber.Contexts.CustomContext.t | Timber.Contexts.ExceptionContext.t | Timber.Contexts.HTTPRequestContext.t | Timber.Contexts.HTTPResponseContext.t | Timber.Contexts.OrganizationContext.t | Timber.Contexts.SQLQueryContext.t | Timber.Contexts.ServerContext.t | Timber.Contexts.TemplateRenderContext.t | Timber.Contexts.UserContext.t
context_type :: :custom | :exception | :http_request | :http_response | :organization | :sql_query | :server | :template_render | :user
t :: %Timber.ContextEntry{data: context_data, dt: String.t, index: non_neg_integer, type: context_type}
Functions
Presents the context the way it should be encoded. The log ingestion system for Timber expects contexts to be encoded such that their type is the key holding the context specific data.
Creates a new context entry for a context stack
The type
passed should match the struct for the data
.
For example, a UserContext
struct should always be passed with
a :user
type. No validation will be done by this function,
however.