diff options
author | Siri Hansen <[email protected]> | 2018-10-03 12:21:23 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-10-03 13:06:25 +0200 |
commit | 6fae4fbd3650366730d35988ee588c32848dbecc (patch) | |
tree | d204f1bf65439f6da5a3ec35e491bd4385752530 /lib/kernel/src/logger.erl | |
parent | 1838418b9193140f6ba5f5716884b62aad7b662d (diff) | |
download | otp-6fae4fbd3650366730d35988ee588c32848dbecc.tar.gz otp-6fae4fbd3650366730d35988ee588c32848dbecc.tar.bz2 otp-6fae4fbd3650366730d35988ee588c32848dbecc.zip |
[logger] Add handler callback filter_config/1
This function is called when a logger API function for fetching
handler configuration is called. The point is to allow the handler to
remove internal data fields that it might have stored in the
configuration database, before returning the handler configuration to
the caller.
An example of such internal data are the 'handler_pid' and 'mode_tab'
fields that logger_std_h and logger_disk_log_h store in their
configuration maps.
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r-- | lib/kernel/src/logger.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl index 3ffa8a0c4e..6762998d4f 100644 --- a/lib/kernel/src/logger.erl +++ b/lib/kernel/src/logger.erl @@ -463,7 +463,14 @@ get_primary_config() -> HandlerId :: handler_id(), Config :: handler_config(). get_handler_config(HandlerId) -> - logger_config:get(?LOGGER_TABLE,HandlerId). + case logger_config:get(?LOGGER_TABLE,HandlerId) of + {ok,#{module:=Module}=Config} -> + {ok,try Module:filter_config(Config) + catch _:_ -> Config + end}; + Error -> + Error + end. -spec get_handler_config() -> [Config] when Config :: handler_config(). |