Skip to content

Commit

Permalink
chore: inspect client name on logs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveigah committed Nov 23, 2024
1 parent 37321c2 commit 526ecbb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/klife/connection/controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ defmodule Klife.Connection.Controller do

def disable_feature(:producer = feature, client_name) do
Logger.warning("""
Producer feature will be disabled.
Producer feature will be disabled for client #{inspect(client_name)}.
This may happen because of:
- API version negotiation failures
Expand All @@ -321,7 +321,7 @@ defmodule Klife.Connection.Controller do

def disable_feature(:txn_producer = feature, client_name) do
Logger.warning("""
Transactions feature will be disabled.
Transactions feature will be disabled for client #{inspect(client_name)}.
This may happen because of:
- API version negotiation failures
Expand All @@ -334,7 +334,7 @@ defmodule Klife.Connection.Controller do

def disable_feature(:producer_idempotence = feature, client_name) do
Logger.warning("""
Producer idempotence feature will be disabled .
Producer idempotence feature will be disabled for client #{inspect(client_name)}.
This may happen because of:
- API version negotiation failures
Expand All @@ -346,7 +346,7 @@ defmodule Klife.Connection.Controller do

def disable_feature(:sasl = feature, client_name) do
Logger.warning("""
SASL feature will be disabled.
SASL feature will be disabled for client #{inspect(client_name)}.
This may happen because of:
- API version negotiation failures
Expand Down
2 changes: 1 addition & 1 deletion lib/klife/producer/dispatcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ defmodule Klife.Producer.Dispatcher do
partition: #{partition}
error_code: #{error_code}
client: #{client_name}
client: #{inspect(client_name)}
broker_id: #{broker_id}
producer_name: #{producer_name}
""")
Expand Down
4 changes: 2 additions & 2 deletions lib/klife/producer/producer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ defmodule Klife.Producer do

{:ok, %{content: %{error_code: ec}}} ->
Logger.error(
"Error code #{ec} returned from broker for client #{state.client_name} on #{inspect(M.InitProducerId)} call"
"Error code #{ec} returned from broker for client #{inspect(state.client_name)} on #{inspect(M.InitProducerId)} call"
)

:retry
Expand Down Expand Up @@ -403,7 +403,7 @@ defmodule Klife.Producer do

{:ok, %{content: %{error_code: ec}}} ->
Logger.error(
"Error code #{ec} returned from broker for client #{state.client_name} on #{inspect(M.FindCoordinator)} call"
"Error code #{ec} returned from broker for client #{inspect(state.client_name)} on #{inspect(M.FindCoordinator)} call"
)

:retry
Expand Down

0 comments on commit 526ecbb

Please sign in to comment.