Skip to content

Commit

Permalink
Merge pull request #48 from mlaurenzano/master
Browse files Browse the repository at this point in the history
Upgrade logging to use warning over warn
  • Loading branch information
akash-akya authored Sep 27, 2023
2 parents 719b26f + c89daf5 commit 6d90f77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/heartbeat.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule OffBroadwayRedisStream.Heartbeat do
:ok

{:error, %RedisClient.ConnectionError{} = error} when retry_count < @max_retries ->
Logger.warn(
Logger.warning(
"Failed to create group, retry_count: #{retry_count}, reason: #{inspect(error.reason)}"
)

Expand All @@ -69,7 +69,7 @@ defmodule OffBroadwayRedisStream.Heartbeat do
Process.send_after(self(), :heartbeat, interval)

{:error, %RedisClient.ConnectionError{} = error} when retry_count < @max_retries ->
Logger.warn(
Logger.warning(
"Failed to send heartbeat, retry_count: #{retry_count}, reason: #{inspect(error.reason)}"
)

Expand Down
10 changes: 5 additions & 5 deletions lib/producer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ defmodule OffBroadwayRedisStream.Producer do
{:noreply, [], %{state | pending_ack: []}}

{:error, error} ->
Logger.warn(
Logger.warning(
"Unable to acknowledge and delete messages with Redis. Reason: #{inspect(error)}"
)

Expand All @@ -175,7 +175,7 @@ defmodule OffBroadwayRedisStream.Producer do
{:noreply, [], %{state | pending_ack: []}}

{:error, error} ->
Logger.warn("Unable to acknowledge messages with Redis. Reason: #{inspect(error)}")
Logger.warning("Unable to acknowledge messages with Redis. Reason: #{inspect(error)}")

if length(ids) > state.max_pending_ack do
{:stop, "Pending ack count is more than maximum limit #{state.max_pending_ack}", state}
Expand All @@ -197,7 +197,7 @@ defmodule OffBroadwayRedisStream.Producer do
:ok

{:error, error} ->
Logger.warn(
Logger.warning(
"Unable to acknowledge and delete messages with Redis. Reason: #{inspect(error)}"
)
end
Expand All @@ -213,7 +213,7 @@ defmodule OffBroadwayRedisStream.Producer do
:ok

{:error, error} ->
Logger.warn("Unable to acknowledge messages with Redis. Reason: #{inspect(error)}")
Logger.warning("Unable to acknowledge messages with Redis. Reason: #{inspect(error)}")
end

Heartbeat.stop(state.heartbeat_pid)
Expand Down Expand Up @@ -463,7 +463,7 @@ defmodule OffBroadwayRedisStream.Producer do

case apply(client, func, args ++ [redis_config]) do
{:error, %RedisClient.ConnectionError{} = error} when retry_count < max_retries ->
Logger.warn(
Logger.warning(
"Failed to run #{func}, retry_count: #{retry_count}, reason: #{inspect(error.reason)}"
)

Expand Down

0 comments on commit 6d90f77

Please sign in to comment.