Skip to content

Commit

Permalink
Fix calls to deprecated Logger.warn/2 (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisMT authored Jun 21, 2023
1 parent 2ec647c commit e8d1d75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/quantum.ex
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,14 @@ defmodule Quantum do
|> Enum.reduce(%{}, fn %Job{name: name} = job, acc ->
cond do
duplicate_job?(Map.keys(acc), job) ->
Logger.warn(
Logger.warning(
"Job with name '#{name}' of scheduler '#{scheduler}' not started: duplicate job name"
)

acc

invalid_job_task?(job) ->
Logger.warn(
Logger.warning(
"Job with name '#{name}' of scheduler '#{scheduler}' not started: invalid task function"
)

Expand Down
6 changes: 3 additions & 3 deletions lib/quantum/date_library.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule Quantum.DateLibrary do
raise InvalidTimezoneError

{:error, :utc_only_time_zone_database} ->
Logger.warn("Timezone database not set up")
Logger.warning("Timezone database not set up")
raise InvalidTimezoneError
end

Expand All @@ -38,7 +38,7 @@ defmodule Quantum.DateLibrary do
DateTime.to_naive(dt)

{:error, :utc_only_time_zone_database} ->
Logger.warn("Timezone database not set up")
Logger.warning("Timezone database not set up")
raise InvalidTimezoneError
end
end
Expand All @@ -61,7 +61,7 @@ defmodule Quantum.DateLibrary do
raise InvalidTimezoneError

{:error, :utc_only_time_zone_database} ->
Logger.warn("Timezone database not set up")
Logger.warning("Timezone database not set up")
raise InvalidTimezoneError
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/quantum/execution_broadcaster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ defmodule Quantum.ExecutionBroadcaster do
add_to_state(state, time, date, job)

{:error, _} ->
Logger.warn(fn ->
Logger.warning(fn ->
"""
Invalid Schedule #{inspect(schedule)} provided for job #{inspect(name)}.
No matching dates found. The job was removed.
Expand Down Expand Up @@ -284,7 +284,7 @@ defmodule Quantum.ExecutionBroadcaster do
_ in InvalidDateTimeForTimezoneError ->
next_time = NaiveDateTime.add(time, 60, :second)

Logger.warn(fn ->
Logger.warning(fn ->
"""
Next execution time for job #{inspect(name)} is not a valid time.
Retrying with #{inspect(next_time)}
Expand Down

0 comments on commit e8d1d75

Please sign in to comment.