From 7ec495409f4c2a30d76c76e0cda0beadac964c01 Mon Sep 17 00:00:00 2001 From: TheFirstAvenger Date: Wed, 17 Jun 2020 16:24:52 -0400 Subject: [PATCH] Fix typespec on add_context since keyword is a valid type --- lib/timber.ex | 4 ++-- lib/timber/local_context.ex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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)