From a006915a4f3ebbff84ccc83fb87f0283ebe49e8e Mon Sep 17 00:00:00 2001
From: Siri Hansen
Date: Wed, 3 Oct 2018 12:41:28 +0200
Subject: [logger] Add update_handler_config/3
This function is similar to set_handler_config/3, but calls the handler
callback changing_config/3 with the first parameter SetOrUpdate=update.
---
lib/kernel/doc/src/logger.xml | 48 +++++++++++++++++++++++++++++++++--
lib/kernel/doc/src/logger_chapter.xml | 14 ++++++----
2 files changed, 55 insertions(+), 7 deletions(-)
(limited to 'lib/kernel/doc')
diff --git a/lib/kernel/doc/src/logger.xml b/lib/kernel/doc/src/logger.xml
index 8f54d0e54f..aa6e17f27b 100644
--- a/lib/kernel/doc/src/logger.xml
+++ b/lib/kernel/doc/src/logger.xml
@@ -748,6 +748,14 @@ start(_, []) ->
exists, its associated value will be changed
to the given value. If it does not exist, it will
be added.
+ If the value is incomplete, which for example can be the
+ case for the config key, it is up to the handler
+ implementation how the unspecified parts are set. For all
+ handlers in the Kernel application, unspecified data for
+ the config key is set to default values. To update
+ only specified data, and keep the existing configuration for
+ the rest, use
+ update_handler_config/3.
See the definition of
the
handler_config() type for more
@@ -932,6 +940,42 @@ logger:set_handler_config(HandlerId, maps:merge(Old, Config)).
+
+
+
+
+
+
+ Add or update configuration data for the specified
+ handler.
+
+
+
+
+
+
+
+
+ Add or update configuration data for the specified
+ handler. If the given Key already
+ exists, its associated value will be changed
+ to the given value. If it does not exist, it will
+ be added.
+ If the value is incomplete, which for example can be the
+ case for the config key, it is up to the handler
+ implementation how the unspecified parts are set. For all
+ handlers in the Kernel application, unspecified data for
+ the config key is not changed. To reset unspecified
+ data to default values,
+ use
+ set_handler_config/3.
+ See the definition of
+ the
+ handler_config() type for more
+ information about the different parameters.
+
+
+
Update primary configuration data for Logger.
@@ -1063,7 +1107,7 @@ logger:set_process_metadata(maps:merge(logger:get_process_metadata(), Meta)).
set_handler_config/2,3, and update
if it originates from
- update_handler_config/2. The handler can
+ update_handler_config/2,3. The handler can
use this parameteter to decide how to update the value of
the config field, that is, the handler specific
configuration data. Typically, if SetOrUpdate
@@ -1150,7 +1194,7 @@ logger:set_process_metadata(maps:merge(logger:get_process_metadata(), Meta)).
-
logger:set_handler_config/2,3
-
- logger:updata_handler_config/2
+ logger:updata_handler_config/2,3
-
logger:update_formatter_config/2
diff --git a/lib/kernel/doc/src/logger_chapter.xml b/lib/kernel/doc/src/logger_chapter.xml
index 7e88f82dad..777c37058e 100644
--- a/lib/kernel/doc/src/logger_chapter.xml
+++ b/lib/kernel/doc/src/logger_chapter.xml
@@ -555,7 +555,7 @@ logger:debug(#{got => connection_request, id => Id, state => State},
-
set_handler_config/2,3
-
- update_handler_config/2
+ update_handler_config/2,3
-
add_handler_filter/3
-
@@ -704,9 +704,13 @@ logger:debug(#{got => connection_request, id => Id, state => State},
-
If HandlerId is default, then this entry
modifies the default handler, equivalent to calling
-
- logger:set_handler_config(default, Module, HandlerConfig)
-
+
+ logger:remove_handler(default)
+
+ followed by
+
+ logger:add_handler(default, Module, HandlerConfig)
+
For all other values of HandlerId, this entry
adds a new handler, equivalent to calling
@@ -1043,7 +1047,7 @@ ok
When
logger:set_handler_config/2,3
or
- logger:update_handler_config/2 is called,
+ logger:update_handler_config/2,3
is called,
Logger
calls HModule:changing_config(SetOrUpdate, OldConfig, NewConfig). If
this function returns {ok,NewConfig1}, Logger
--
cgit v1.2.3