Skip to content

Commit 73a41cc

Browse files
committed
rabbit_logger_exchange_h: Register setup process
[Why] It makes debugging easier, especially now that this process does more than the initial setup: it acts as the actual publisher of the log messages.
1 parent 7cc0aa9 commit 73a41cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

deps/rabbit/src/rabbit_logger_exchange_h.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,13 @@ wait_for_initial_pass(N) ->
180180
end.
181181

182182
setup_proc(
183-
#{config := #{exchange := Exchange}} = Config) ->
183+
#{id := Id,
184+
config := #{exchange := Exchange}} = Config) ->
185+
%% We register this process using the logger handler ID. It makes
186+
%% debugging convenient but it's not critical. That's why we catch any
187+
%% exceptions and ignore the return value.
188+
_ = catch erlang:register(Id, self()),
189+
184190
case declare_exchange(Config) of
185191
ok ->
186192
?LOG_INFO(

0 commit comments

Comments
 (0)