Skip to content

Commit

Permalink
Provide a function to re-enable the report
Browse files Browse the repository at this point in the history
  • Loading branch information
ono committed Dec 29, 2020
1 parent e9ca8db commit 78e79fa
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/amqp/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,22 @@ defmodule AMQP.Application do
:amqp_ignore_rabbitmq_progress_reports,
{&:logger_filters.domain/2, {:stop, :equal, [:progress]}}
)

:ok
rescue
e ->
Logger.warn("Failed to disable progress report by Erlang library: detail: #{inspect(e)}")
{:error, e}
end

@doc """
Enables the progress report logging from Erlang library.
"""
@spec enable_progress_report :: :ok | {:error, any}
def enable_progress_report do
case :logger.remove_primary_filter(:amqp_ignore_rabbitmq_progress_reports) do
:ok -> :ok
# filter already removed
{:error, {:not_found, _}} -> :ok
error -> error
end
end
end

0 comments on commit 78e79fa

Please sign in to comment.