|
|
@ -74,10 +74,10 @@ handle_event(Event, State) -> |
|
|
|
Offender = format_offender(Off), |
|
|
|
?LOG(error, Pid, "Supervisor ~w had child ~s exit with reason ~w in context ~w", [element(2, Name), Offender, Reason, Ctx]); |
|
|
|
_ -> |
|
|
|
?LOG(error, Pid, "SUPERVISOR REPORT " ++ print_silly_list(D)) |
|
|
|
?LOG(error, Pid, ["SUPERVISOR REPORT ", print_silly_list(D)]) |
|
|
|
end; |
|
|
|
{error_report, _GL, {Pid, crash_report, [Self, Neighbours]}} -> |
|
|
|
?LOG(error, Pid, "CRASH REPORT " ++ format_crash_report(Self, Neighbours)); |
|
|
|
?LOG(error, Pid, ["CRASH REPORT ", format_crash_report(Self, Neighbours)]); |
|
|
|
{info_msg, _GL, {Pid, Fmt, Args}} -> |
|
|
|
?LOG(info, Pid, Fmt, Args); |
|
|
|
{info_report, _GL, {Pid, std_info, D}} -> |
|
|
@ -99,7 +99,7 @@ handle_event(Event, State) -> |
|
|
|
Pid = proplists:get_value(pid, Started), |
|
|
|
?LOG(info, P, "Supervisor ~w started ~s at pid ~w", [element(2, Name), MFA, Pid]); |
|
|
|
_ -> |
|
|
|
?LOG(info, P, "PROGRESS REPORT " ++ print_silly_list(D)) |
|
|
|
?LOG(info, P, ["PROGRESS REPORT ", print_silly_list(D)]) |
|
|
|
end; |
|
|
|
_ -> |
|
|
|
io:format("Event ~w~n", [Event]) |
|
|
@ -134,39 +134,39 @@ format_offender(Off) -> |
|
|
|
end. |
|
|
|
|
|
|
|
format_reason({'function not exported', [{M, F, A},MFA|_]}) -> |
|
|
|
"call to undefined function " ++ format_mfa({M, F, length(A)}) ++ " from " ++ format_mfa(MFA); |
|
|
|
["call to undefined function ", format_mfa({M, F, length(A)}), " from ", format_mfa(MFA)]; |
|
|
|
format_reason({undef, [MFA|_]}) -> |
|
|
|
"call to undefined function " ++ format_mfa(MFA); |
|
|
|
["call to undefined function ", format_mfa(MFA)]; |
|
|
|
format_reason({bad_return_value, Val}) -> |
|
|
|
io_lib:format("bad return value: ~w", [Val]); |
|
|
|
format_reason({{case_clause, Val}, [MFA|_]}) -> |
|
|
|
io_lib:format("no case clause matching ~w in ", [Val]) ++ format_mfa(MFA); |
|
|
|
[io_lib:format("no case clause matching ~w in ", [Val]), format_mfa(MFA)]; |
|
|
|
format_reason({function_clause, [MFA|_]}) -> |
|
|
|
"no function clause matching " ++ format_mfa(MFA); |
|
|
|
["no function clause matching ", format_mfa(MFA)]; |
|
|
|
format_reason({if_clause, [MFA|_]}) -> |
|
|
|
"no true branch found while evaluating if expression in " ++ format_mfa(MFA); |
|
|
|
["no true branch found while evaluating if expression in ", format_mfa(MFA)]; |
|
|
|
format_reason({{try_clause, Val}, [MFA|_]}) -> |
|
|
|
io_lib:format("no try clause matching ~w in ", [Val]) ++ format_mfa(MFA); |
|
|
|
[io_lib:format("no try clause matching ~w in ", [Val]), format_mfa(MFA)]; |
|
|
|
format_reason({badarith, [MFA|_]}) -> |
|
|
|
"bad arithmetic expression in " ++ format_mfa(MFA); |
|
|
|
["bad arithmetic expression in ", format_mfa(MFA)]; |
|
|
|
format_reason({{badmatch, Val}, [MFA|_]}) -> |
|
|
|
io_lib:format("no match of right hand value ~w in ", [Val]) ++ format_mfa(MFA); |
|
|
|
[io_lib:format("no match of right hand value ~w in ", [Val]), format_mfa(MFA)]; |
|
|
|
%format_reason({system_limit, |
|
|
|
format_reason({badarg, [MFA,MFA2|_]}) -> |
|
|
|
case MFA of |
|
|
|
{_M, _F, A} when is_list(A) -> |
|
|
|
"bad argument in call to " ++ format_mfa(MFA) ++ " in " ++ format_mfa(MFA2); |
|
|
|
["bad argument in call to ", format_mfa(MFA), " in ", format_mfa(MFA2)]; |
|
|
|
_ -> |
|
|
|
%% seems to be generated by a bad call to a BIF |
|
|
|
"bad argument in " ++ format_mfa(MFA) |
|
|
|
["bad argument in ", format_mfa(MFA)] |
|
|
|
end; |
|
|
|
format_reason({{badarity, {Fun, Args}}, [MFA|_]}) -> |
|
|
|
{arity, Arity} = lists:keyfind(arity, 1, erlang:fun_info(Fun)), |
|
|
|
io_lib:format("fun called with wrong arity of ~w instead of ~w in ", [length(Args), Arity]) ++ format_mfa(MFA); |
|
|
|
[io_lib:format("fun called with wrong arity of ~w instead of ~w in ", [length(Args), Arity]), format_mfa(MFA)]; |
|
|
|
format_reason({noproc, MFA}) -> |
|
|
|
"no such process or port in call to " ++ format_mfa(MFA); |
|
|
|
["no such process or port in call to ", format_mfa(MFA)]; |
|
|
|
format_reason({{badfun, Term}, [MFA|_]}) -> |
|
|
|
io_lib:format("bad function ~w in ", [Term]) ++ format_mfa(MFA); |
|
|
|
[io_lib:format("bad function ~w in ", [Term]), format_mfa(MFA)]; |
|
|
|
format_reason(Reason) -> |
|
|
|
{Str, _} = trunc_io:print(Reason, 500), |
|
|
|
Str. |
|
|
|