Browse Source

Couple fixes

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

+ 2
- 2
src/lager_transform.erl View File

@ -150,7 +150,7 @@ do_transform(Line, SinkName, Severity, Arguments0, Safety) ->
{cons, Line, {tuple, Line, [ {cons, Line, {tuple, Line, [
{atom, Line, gl}, {call, Line, {atom, Line, group_leader}, []}]}, {atom, Line, gl}, {call, Line, {atom, Line, group_leader}, []}]},
{cons, Line, {tuple, Line, [ {cons, Line, {tuple, Line, [
{atom, Line, time}, {call, {remote, Line, {atom, Line, erlang}, {atom, Line, system_time}}, [{atom, Line, microsecond}]}]},
{atom, Line, time}, {call, Line, {remote, Line, {atom, Line, erlang}, {atom, Line, system_time}}, [{atom, Line, microsecond}]}]},
{cons, Line, {tuple, Line, [ {cons, Line, {tuple, Line, [
{atom, Line, mfa}, {tuple, Line, [{atom, Line, get(module)}, {atom, Line, get(function)}, {atom, Line, get(arity)}]}]}, {atom, Line, mfa}, {tuple, Line, [{atom, Line, get(module)}, {atom, Line, get(function)}, {atom, Line, get(arity)}]}]},
{cons, Line, {tuple, Line, [ {cons, Line, {tuple, Line, [
@ -193,7 +193,7 @@ do_transform(Line, SinkName, Severity, Arguments0, Safety) ->
case get(use_logger) of case get(use_logger) of
true -> true ->
{call,Line,{remote, Line, {atom, Line, logger}, {atom, Line, log}}, {call,Line,{remote, Line, {atom, Line, logger}, {atom, Line, log}},
[{atom,Line,Severity}, Message, Arguments, Meta]};
[{atom,Line,Severity}, Message, Arguments, {call, Line, {remote, Line, {atom, Line, maps}, {atom, Line, from_list}}, [Meta]}]};
false -> false ->
SeverityAsInt=lager_util:level_to_num(Severity), SeverityAsInt=lager_util:level_to_num(Severity),
%% Generate some unique variable names so we don't accidentally export from case clauses. %% Generate some unique variable names so we don't accidentally export from case clauses.

Loading…
Cancel
Save