Skip to content

Commit

Permalink
Merge pull request #2807 from max-au/max-au/logger-qualify-apply/OTP-…
Browse files Browse the repository at this point in the history
…16976

logger.hrl: use fully qualifier call to erlang:apply
  • Loading branch information
garazdawi committed Oct 27, 2020
2 parents 2eeeee2 + 09e1a36 commit 0b2c63c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kernel/include/logger.hrl
Expand Up @@ -46,7 +46,7 @@
-define(DO_LOG(Level,Args),
case logger:allow(Level,?MODULE) of
true ->
apply(logger,macro_log,[?LOCATION,Level|Args]);
erlang:apply(logger,macro_log,[?LOCATION,Level|Args]);
false ->
ok
end).
Expand Down
8 changes: 7 additions & 1 deletion lib/kernel/test/logger_SUITE.erl
Expand Up @@ -68,7 +68,7 @@ init_per_testcase(_TestCase, Config) ->
[{logger_config,PC}|Config].

end_per_testcase(Case, Config) ->
try apply(?MODULE,Case,[cleanup,Config])
try erlang:apply(?MODULE,Case,[cleanup,Config])
catch error:undef -> ok
end,
ok.
Expand Down Expand Up @@ -1408,3 +1408,9 @@ check_config(crash) ->
erlang:error({badmatch,3});
check_config(_) ->
ok.

%% this function is also a test. When logger.hrl used non-qualified
%% apply/3 call, any module that was implementing apply/3 could
%% not use any logging macro
apply(_Any, _Any, _Any) ->
ok.

0 comments on commit 0b2c63c

Please sign in to comment.