diff --git a/lib/timber.ex b/lib/timber.ex index af72be8..236201c 100644 --- a/lib/timber.ex +++ b/lib/timber.ex @@ -35,7 +35,7 @@ defmodule Timber do See `add_context/2` """ - @spec add_context(map()) :: :ok + @spec add_context(map() | keyword()) :: :ok def add_context(data, location \\ :local) @doc """ @@ -44,7 +44,7 @@ defmodule Timber do The second parameter indicates where you want the context to be stored. See `context_location` for more details. """ - @spec add_context(map(), context_location) :: :ok + @spec add_context(map() | keyword(), context_location) :: :ok def add_context(data, :local) do LocalContext.add(data) end diff --git a/lib/timber/local_context.ex b/lib/timber/local_context.ex index d78df3b..e9285ff 100644 --- a/lib/timber/local_context.ex +++ b/lib/timber/local_context.ex @@ -16,7 +16,7 @@ defmodule Timber.LocalContext do `Timber.Context.add/2` is called to merge the existing context with the provided context. """ - @spec add(map()) :: :ok + @spec add(map() | keyword()) :: :ok def add(context) do load() |> Context.merge(context)