Timber v3.1.2 Timber.Contexts.CustomContext View Source

DEPRECATED

The Timber.Contexts.CustomContext module is deprecated in favor of using simple maps:

Timber.add_context(build: %{version: "1.0.0"})

If you'd like, you can define your contexts as structs and implement the Timber.Contextable protocol:

defmodule BuildContext do
  defstruct [:version]

  defimpl Timber.Contextable do
    def to_context(context) do
      map = Map.from_struct(context)
      %{build: map}
    end
  end
end

Link to this section Summary

Link to this section Types

Link to this type

m() View Source
m() :: %{type: atom(), data: %{optional(String.t()) => any()}}

Link to this type

t() View Source
t() :: %Timber.Contexts.CustomContext{
  data: %{optional(String.t()) => any()},
  type: atom()
}