Browse Source

Severities must be convertible to numbers

pull/278/head
John R. Daily 9 years ago
parent
commit
cf5b39c64f
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      include/lager.hrl
  2. +3
    -3
      src/lager_transform.erl

+ 1
- 1
include/lager.hrl View File

@ -25,7 +25,7 @@
%% Use of these "functions" means that the argument list will not be
%% truncated for safety
-define(LEVELS_UNSAFE,
[debug_unsafe, info_unsafe, notice_unsafe, warning_unsafe, error_unsafe, critical_unsafe, alert_unsafe, emergency_unsafe]).
[{debug_unsafe, debug}, {info_unsafe, info}, {notice_unsafe, notice}, {warning_unsafe, warning}, {error_unsafe, error}, {critical_unsafe, critical}, {alert_unsafe, alert}, {emergency_unsafe, emergency}]).
-define(DEBUG, 128).
-define(INFO, 64).

+ 3
- 3
src/lager_transform.erl View File

@ -89,10 +89,10 @@ transform_statement({call, Line, {remote, _Line1, {atom, _Line2, Module},
SinkName = list_to_atom(atom_to_list(Module) ++ "_event"),
do_transform(Line, SinkName, Function, Arguments0);
false ->
case lists:member(Function, ?LEVELS_UNSAFE) of
true ->
case lists:keyfind(Function, 1, ?LEVELS_UNSAFE) of
{Function, Severity} ->
SinkName = list_to_atom(atom_to_list(Module) ++ "_event"),
do_transform(Line, SinkName, Function, Arguments0, unsafe);
do_transform(Line, SinkName, Severity, Arguments0, unsafe);
false ->
Stmt
end

Loading…
Cancel
Save