Browse Source

Fix

adt/lager_use_logger-option
Andrew Thompson 6 years ago
parent
commit
225990798f
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/lager_logger_formatter.erl

+ 2
- 0
src/lager_logger_formatter.erl View File

@ -87,8 +87,10 @@ format(#{msg := {report, _Report}, meta := Metadata} = Event, #{report_cb := Fun
format(Event#{meta => Metadata#{report_cb => Fun}}, maps:remove(report_cb, Config)); format(Event#{meta => Metadata#{report_cb => Fun}}, maps:remove(report_cb, Config));
format(#{level := _Level, msg := {report, Report}, meta := #{report_cb := Fun}} = Event, Config) when is_function(Fun, 1) -> format(#{level := _Level, msg := {report, Report}, meta := #{report_cb := Fun}} = Event, Config) when is_function(Fun, 1) ->
case Fun(Report) of case Fun(Report) of
{"", []} -> "";
{Format, Args} when is_list(Format), is_list(Args) -> {Format, Args} when is_list(Format), is_list(Args) ->
format(Event#{msg => {Format, Args}}, Config); format(Event#{msg => {Format, Args}}, Config);
"" -> "";
String -> String ->
format(Event#{msg => {string, String}}, Config) format(Event#{msg => {string, String}}, Config)
end; end;

Loading…
Cancel
Save