aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-06-04 19:53:02 +0200
committerSiri Hansen <[email protected]>2018-06-08 14:41:34 +0200
commit983a945b84e15f58c3205c37b7bfcad18537325c (patch)
treea1fdce539da80b497bffe3a2c5cba868cb6755d8 /lib/kernel/src/logger.erl
parente5bbcfd47088162a1c349eeb5aa3c37d8263d274 (diff)
downloadotp-983a945b84e15f58c3205c37b7bfcad18537325c.tar.gz
otp-983a945b84e15f58c3205c37b7bfcad18537325c.tar.bz2
otp-983a945b84e15f58c3205c37b7bfcad18537325c.zip
[logger] Add configurable log levels 'all' and 'none'
New default for handlers is 'all'.
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r--lib/kernel/src/logger.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index 395ec448ff..f18f101930 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -96,7 +96,7 @@
-type filter_arg() :: term().
-type filter_return() :: stop | ignore | log_event().
-type config() :: #{id => handler_id(),
- level => level(),
+ level => level() | all | none,
filter_default => log | stop,
filters => [{filter_id(),filter()}],
formatter => {module(),formatter_config()},
@@ -412,7 +412,7 @@ update_formatter_config(HandlerId,Key,Value) ->
-spec set_module_level(Modules,Level) -> ok | {error,term()} when
Modules :: [module()] | module(),
- Level :: level().
+ Level :: level() | all | none.
set_module_level(Module,Level) when is_atom(Module) ->
set_module_level([Module],Level);
set_module_level(Modules,Level) ->
@@ -432,7 +432,7 @@ unset_module_level() ->
-spec get_module_level(Modules) -> [{Module,Level}] when
Modules :: [Module] | Module,
Module :: module(),
- Level :: level().
+ Level :: level() | all | none.
get_module_level(Module) when is_atom(Module) ->
get_module_level([Module]);
get_module_level(Modules) when is_list(Modules) ->
@@ -441,7 +441,7 @@ get_module_level(Modules) when is_list(Modules) ->
-spec get_module_level() -> [{Module,Level}] when
Module :: module(),
- Level :: level().
+ Level :: level() | all | none.
get_module_level() ->
logger_config:get_module_level(?LOGGER_TABLE).
@@ -494,13 +494,13 @@ unset_process_metadata() ->
-spec i() -> #{logger=>config(),
handlers=>[{handler_id(),module(),config()}],
- module_levels=>[{module(),level()}]}.
+ module_levels=>[{module(),level() | all | none}]}.
i() ->
i(term).
-spec i(term) -> #{logger=>config(),
handlers=>[{handler_id(),module(),config()}],
- module_levels=>[{module(),level()}]};
+ module_levels=>[{module(),level() | all | none}]};
(print) -> ok;
(string) -> iolist().
i(_Action = print) ->