aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-06-07 11:47:05 +0200
committerSiri Hansen <[email protected]>2018-06-08 14:48:14 +0200
commitf20c281be6fa27e2da1c543a64029531c5f00325 (patch)
tree531da0cc6860757a7fce868a2b4b484b5c685055 /lib/kernel/src/logger.erl
parent7f6e61ca0d752c780ffadd7aacf29aaab0783c78 (diff)
downloadotp-f20c281be6fa27e2da1c543a64029531c5f00325.tar.gz
otp-f20c281be6fa27e2da1c543a64029531c5f00325.tar.bz2
otp-f20c281be6fa27e2da1c543a64029531c5f00325.zip
[logger] Update return values from get_handler_config/0,1 and get_config/0
Module and Id are now always included as fields in Config, so these are no longer returned as separate elements.
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r--lib/kernel/src/logger.erl20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index df7ce22e2a..f6dc8ea397 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -390,21 +390,23 @@ get_primary_config() ->
{ok,Config} = logger_config:get(?LOGGER_TABLE,primary),
maps:remove(handlers,Config).
--spec get_handler_config(HandlerId) -> {ok,{Module,Config}} | {error,term()} when
+-spec get_handler_config(HandlerId) -> {ok,Config} | {error,term()} when
HandlerId :: handler_id(),
- Module :: module(),
Config :: config().
get_handler_config(HandlerId) ->
- logger_config:get(?LOGGER_TABLE,HandlerId).
+ case logger_config:get(?LOGGER_TABLE,HandlerId) of
+ {ok,{_,Config}} ->
+ {ok,Config};
+ Error ->
+ Error
+ end.
--spec get_handler_config() -> [{HandlerId,Module,Config}] when
- HandlerId :: handler_id(),
- Module :: module(),
+-spec get_handler_config() -> [Config] when
Config :: config().
get_handler_config() ->
[begin
- {ok,{Module,Config}} = get_handler_config(HandlerId),
- {HandlerId,Module,Config}
+ {ok,Config} = get_handler_config(HandlerId),
+ Config
end || HandlerId <- get_handler_ids()].
-spec get_handler_ids() -> [HandlerId] when
@@ -511,7 +513,7 @@ unset_process_metadata() ->
ok.
-spec get_config() -> #{primary=>config(),
- handlers=>[{handler_id(),module(),config()}],
+ handlers=>[config()],
module_levels=>[{module(),level() | all | none}]}.
get_config() ->
#{primary=>get_primary_config(),