aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-05-18 13:27:56 +0200
committerSiri Hansen <[email protected]>2018-05-23 11:11:13 +0200
commitcfbe1afe6ba1f1083c8aa41c7aeb422f253f5d23 (patch)
treee3cd42484d0d76b40e75e679fe4e41936b3bfc2f /lib/kernel/src/logger.erl
parentbe959158a9ebe4b4ed8c336b969ac0c0e9399312 (diff)
downloadotp-cfbe1afe6ba1f1083c8aa41c7aeb422f253f5d23.tar.gz
otp-cfbe1afe6ba1f1083c8aa41c7aeb422f253f5d23.tar.bz2
otp-cfbe1afe6ba1f1083c8aa41c7aeb422f253f5d23.zip
Add logger:update_formatter_config/2,3
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r--lib/kernel/src/logger.erl18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index 51743822af..d60be180bc 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -41,6 +41,7 @@
set_logger_config/1, set_logger_config/2,
set_handler_config/2, set_handler_config/3,
update_logger_config/1, update_handler_config/2,
+ update_formatter_config/2, update_formatter_config/3,
get_logger_config/0, get_handler_config/1,
add_handlers/1]).
@@ -92,7 +93,7 @@
-type config() :: #{level => level(),
filter_default => log | stop,
filters => [{filter_id(),filter()}],
- formatter => {module(),term()},
+ formatter => {module(),map()},
term() => term()}.
-type timestamp() :: integer().
@@ -386,6 +387,21 @@ get_logger_config() ->
get_handler_config(HandlerId) ->
logger_config:get(?LOGGER_TABLE,HandlerId).
+-spec update_formatter_config(HandlerId,FormatterConfig) ->
+ ok | {error,term()} when
+ HandlerId :: config(),
+ FormatterConfig :: map().
+update_formatter_config(HandlerId,FormatterConfig) ->
+ logger_server:update_formatter_config(HandlerId,FormatterConfig).
+
+-spec update_formatter_config(HandlerId,Key,Value) ->
+ ok | {error,term()} when
+ HandlerId :: config(),
+ Key :: atom(),
+ Value :: term().
+update_formatter_config(HandlerId,Key,Value) ->
+ logger_server:update_formatter_config(HandlerId,#{Key=>Value}).
+
-spec set_module_level(Module,Level) -> ok | {error,term()} when
Module :: module(),
Level :: level().