Skip to content

Commit

Permalink
Fix return value from init; add specs to verify
Browse files Browse the repository at this point in the history
The return value from init was in an extra tuple which wasn't what
:gen_event wanted.
  • Loading branch information
fhunleth authored and mobileoverlord committed Apr 15, 2018
1 parent e109a3d commit a12ed1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ring_logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ defmodule RingLogger do
#
# Logger backend callbacks
#
@spec init(module()) :: {:ok, term()} | {:error, term()}
def init(__MODULE__) do
{:ok, init({__MODULE__, []})}
init({__MODULE__, []})
end

@spec init({module(), list()}) :: {:ok, term()} | {:error, term()}
def init({__MODULE__, opts}) when is_list(opts) do
env = Application.get_env(:logger, __MODULE__, [])
opts = Keyword.merge(env, opts)
Expand Down

0 comments on commit a12ed1f

Please sign in to comment.