Skip to content

Commit

Permalink
Merge pull request #574 from firx/logger-error-fix
Browse files Browse the repository at this point in the history
Suppress error when default logger handler already removed
  • Loading branch information
Vagabond authored Nov 2, 2023
2 parents fb340d7 + 29082d9 commit 1418c7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lager_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ maybe_remove_logger_handler() ->
try
ok = logger:remove_handler(default)
catch
error:undef -> ok;
error:undef -> ok; %% No remove_handler(), OTP < 21.1
error:{badmatch, {error, {not_found, default}}} -> ok; %% No default handler, already removed
Err:Reason ->
error_logger:error_msg("calling logger:remove_handler(default) failed: ~p ~p",
[Err, Reason])
Expand Down

0 comments on commit 1418c7c

Please sign in to comment.