Browse Source

Fix

adt/lager_use_logger-option
Andrew Thompson 6 years ago
parent
commit
3d38191cee
1 changed files with 4 additions and 7 deletions
  1. +4
    -7
      src/lager_logger_formatter.erl

+ 4
- 7
src/lager_logger_formatter.erl View File

@ -22,7 +22,7 @@ report_cb(#{msg := {report, #{label := {Behaviour, no_handle_info}, mod := Mod,
report_cb(#{label := {supervisor, progress}, report := Report}) ->
case application:get_env(lager, suppress_supervisor_start_stop, false) of
true ->
"";
{"", []};
false ->
{supervisor, Name} = lists:keyfind(supervisor, 1, Report),
{started, Started} = lists:keyfind(started, 1, Report),
@ -65,7 +65,7 @@ report_cb(#{label := {supervisor, _Error}, report := Report}) ->
end;
report_cb(#{label := {application_controller, progress}, report := Report}) ->
case application:get_env(lager, suppress_application_start_stop, false) of
true -> "";
true -> {"", []};
false ->
{application, Name} = lists:keyfind(application, 1, Report),
{started_at, Node} = lists:keyfind(started_at, 1, Report),
@ -75,7 +75,7 @@ report_cb(#{label := {application_controller, exit}, report := Report}) ->
{exited, Reason} = lists:keyfind(exited, 1, Report),
case application:get_env(lager, suppress_application_start_stop) of
{ok, true} when Reason == stopped ->
"";
{"", []};
_ ->
{application, Name} = lists:keyfind(application, 1, Report),
{_Md, Formatted} = error_logger_lager_h:format_reason_md(Reason),
@ -89,10 +89,7 @@ format(#{level := _Level, msg := {report, Report}, meta := #{report_cb := Fun}}
case Fun(Report) of
{"", []} -> "";
{Format, Args} when is_list(Format), is_list(Args) ->
format(Event#{msg => {Format, Args}}, Config);
"" -> "";
String ->
format(Event#{msg => {string, String}}, Config)
format(Event#{msg => {Format, Args}}, Config)
end;
format(#{level := Level, msg := {string, String}, meta := Metadata}, Config) ->
do_format(Level, String, Metadata, Config);

Loading…
Cancel
Save