aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-07-11 16:13:13 +0200
committerSiri Hansen <[email protected]>2018-07-13 12:20:27 +0200
commit48824be3d833b13a35b92652df372c6ce3c190a0 (patch)
tree6365b9283b33a97bb1e6f585a45255e0afc409af /lib
parent0a4834e59f2aac7b76331410bcee641d375d8ec0 (diff)
downloadotp-48824be3d833b13a35b92652df372c6ce3c190a0.tar.gz
otp-48824be3d833b13a35b92652df372c6ce3c190a0.tar.bz2
otp-48824be3d833b13a35b92652df372c6ce3c190a0.zip
[logger] Allow setting kernel parameter 'logger_level' to 'all'
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/logger.erl2
-rw-r--r--lib/kernel/test/logger_env_var_SUITE.erl19
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index 4924c6cb4f..ffc90f4fc5 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -687,7 +687,7 @@ get_logger_type() ->
get_logger_level() ->
case application:get_env(kernel,logger_level,info) of
- Level when ?IS_LEVEL(Level) ->
+ Level when ?IS_LEVEL(Level); Level=:=all; Level=:=none ->
Level;
Level ->
throw({logger_level, Level})
diff --git a/lib/kernel/test/logger_env_var_SUITE.erl b/lib/kernel/test/logger_env_var_SUITE.erl
index 04a4364947..e8d1a313dc 100644
--- a/lib/kernel/test/logger_env_var_SUITE.erl
+++ b/lib/kernel/test/logger_env_var_SUITE.erl
@@ -71,6 +71,7 @@ all() ->
sasl_compatible_false,
sasl_compatible_false_no_progress,
sasl_compatible,
+ all_logger_level,
{group,bad},
{group,error_logger},
{group,logger}
@@ -572,6 +573,24 @@ sasl_compatible(Config) ->
0),% progress in std logger
ok.
+all_logger_level(Config) ->
+ [all_logger_level(Config,Level) || Level <- [none,
+ emergency,
+ alert,
+ critical,
+ error,
+ warning,
+ notice,
+ info,
+ debug,
+ all]],
+ ok.
+
+all_logger_level(Config,Level) ->
+ {ok,#{primary:=#{level:=Level}},Node} = setup(Config,[{logger_level,Level}]),
+ true = test_server:stop_node(Node),
+ ok.
+
bad_error_logger(Config) ->
error = setup(Config,[{error_logger,baddest}]).