Timber v3.1.2 Timber.LocalContext View Source

Manages Timber context through the Elixir.Logger metadata

This module stores context in the Elixir.Logger metadata, so any context is specific to the process.

For more details about the context data structure, see Timber.Context.

Link to this section Summary

Functions

Merges the provided context into the existing context

Deletes the key from the existing local context

Dumps the context to a Context.t

Sets the provided context, overriding any existing Context

Link to this section Functions

Link to this function

add(context) View Source
add(map()) :: :ok

Merges the provided context into the existing context

Timber.Context.add/2 is called to merge the existing context with the provided context.

Link to this function

delete(key) View Source
delete(atom()) :: :ok

Deletes the key from the existing local context.

Timber.Context.delete/2 is called to delete the key.

Link to this function

get() View Source
get() :: Timber.Context.t()

Dumps the context to a Context.t

This function is used to expose the current context, which is useful if you need to copy the context to a different process.

Link to this function

put(context) View Source
put(Timber.Context.t()) :: :ok

Sets the provided context, overriding any existing Context