Skip to content

Commit

Permalink
warn instead of IO
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Sep 19, 2024
1 parent 9536f5e commit ce2af29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tower_slack/reporter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ defmodule TowerSlack.Reporter do

@default_level :error

require Logger

@impl true
def report_event(%Tower.Event{similarity_id: similarity_id, level: level} = event) do
if Tower.equal_or_greater_level?(level, level()) do
Expand All @@ -16,7 +18,7 @@ defmodule TowerSlack.Reporter do
do_report_event(event)

amount ->
IO.puts(
Logger.warning(
"Ignoring repeated event with similarity_id=#{similarity_id}. Seen #{amount} times."
)
end
Expand Down

0 comments on commit ce2af29

Please sign in to comment.