Skip to content

Commit

Permalink
remove redundant loglevel check (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-tansini authored Jun 14, 2022
1 parent 96c937e commit 9531b24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions lib/prima_ex_logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,10 @@ defmodule PrimaExLogger do
}
end

def handle_event({level, _, _} = event, %{level: min_level, encoder: encoder} = state) do
case Logger.compare_levels(level, min_level) do
:lt ->
nil

_ ->
event
|> forge_event(state)
|> log(encoder)
end
def handle_event(event, %{encoder: encoder} = state) do
event
|> forge_event(state)
|> log(encoder)

{:ok, state}
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule PrimaExLogger.MixProject do
def project do
[
app: :prima_ex_logger,
version: "0.2.3",
version: "0.2.4",
source_url: "https://github.com/primait/prima_ex_logger",
elixir: "~> 1.7",
deps: deps(),
Expand Down

0 comments on commit 9531b24

Please sign in to comment.