From 3d38191ceeb90b7bec05277c36649b2b50ed95ce Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Sat, 9 Feb 2019 13:22:27 -0800 Subject: [PATCH] Fix --- src/lager_logger_formatter.erl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lager_logger_formatter.erl b/src/lager_logger_formatter.erl index 5503526..9871c83 100644 --- a/src/lager_logger_formatter.erl +++ b/src/lager_logger_formatter.erl @@ -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);