From 5d49f8a25005945b7260facc1a985c294746616b Mon Sep 17 00:00:00 2001
From: Siri Hansen
Date: Mon, 14 May 2018 20:27:55 +0200
Subject: Add update_logger_config/1 and update_handler_config/2 to logger
---
lib/kernel/doc/src/logger.xml | 54 +++++++++++++++++++++++++++++++++++--------
1 file changed, 44 insertions(+), 10 deletions(-)
(limited to 'lib/kernel/doc/src')
diff --git a/lib/kernel/doc/src/logger.xml b/lib/kernel/doc/src/logger.xml
index 239b9553b1..183102f240 100644
--- a/lib/kernel/doc/src/logger.xml
+++ b/lib/kernel/doc/src/logger.xml
@@ -645,11 +645,12 @@ start(_, []) ->
Set configuration data for the logger. This overwrites the
current logger configuration.
To modify the existing configuration,
- use set_logger_config/2
- , or read the current configuration
+ use
+ update_logger_config/1, or, if a more
+ complex merge is needed, read the current configuration
with get_logger_config/0
- , then merge in your added or updated
- associations before writing it back.
+ , then do the merge before writing the new
+ configuration back with this function.
If a key is removed compared to the current configuration,
the default value is used.
@@ -662,7 +663,23 @@ start(_, []) ->
Add or update configuration data for the logger. If the
given Key already exists, its associated
value will be changed to Value. If it
- doesn't exist, it will be added.
+ does not exist, it will be added.
+
+
+
+
+
+ Update configuration data for the logger.
+
+ Update configuration data for the logger. This function
+ behaves as if it was implemented as follows:
+
+{ok,Old} = logger:get_logger_config(),
+logger:set_logger_config(maps:merge(Old,Config)).
+
+ To overwrite the existing configuration without any merge,
+ use set_logger_config/1
+ .
@@ -673,11 +690,12 @@ start(_, []) ->
Set configuration data for the specified handler. This
overwrites the current handler configuration.
To modify the existing configuration,
- use set_handler_config/3
- , or read the current configuration
+ use
+ update_handler_config/2, or, if a more
+ complex merge is needed, read the current configuration
with get_handler_config/1
- , then merge in your added or updated
- associations before writing it back.
+ , then do the merge before writing the new
+ configuration back with this function.
If a key is removed compared to the current configuration,
and the key is know by Logger, the default value is used. If
it is a custom key, then it is up to the handler
@@ -694,11 +712,27 @@ start(_, []) ->
Add or update configuration data for the specified
handler. If the given Key already
exists, its associated value will be changed
- to Value. If it doesn't exist, it will
+ to Value. If it does not exist, it will
be added.
+
+
+ Update configuration data for the specified handler.
+
+ Update configuration data for the specified handler. This function
+ behaves as if it was implemented as follows:
+
+{ok,{_,Old}} = logger:get_handler_config(HandlerId),
+logger:set_handler_config(HandlerId,maps:merge(Old,Config)).
+
+ To overwrite the existing configuration without any merge,
+ use set_handler_config/2
+ .
+
+
+
Compare the severity of two log levels.
--
cgit v1.2.3