瀏覽代碼

Use mfargs instead of name attribute as the way to detect supervisor_bridge

As Ryan pointed out, the 'name' of a supervisor's child may be
'undefined' for a simple_one_for_one supervisor.
pull/16/head
Andrew Thompson 13 年之前
父節點
當前提交
6fdbe25071
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      src/error_logger_lager_h.erl

+ 4
- 3
src/error_logger_lager_h.erl 查看文件

@ -153,14 +153,15 @@ format_crash_report(Report, Neighbours) ->
[Name, length(Neighbours), format_reason(Reason)]).
format_offender(Off) ->
case proplists:get_value(name, Off) of
case proplists:get_value(mfargs, Off) of
undefined ->
%% supervisor_bridge
io_lib:format("at module ~w at ~w",
[proplists:get_value(mod, Off), proplists:get_value(pid, Off)]);
Name ->
MFArgs ->
%% regular supervisor
MFA = format_mfa(proplists:get_value(mfargs, Off)),
MFA = format_mfa(MFArgs),
Name = proplists:get_value(name, Off),
io_lib:format("~w started with ~s at ~w",
[Name, MFA, proplists:get_value(pid, Off)])
end.

Loading…
取消
儲存