aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger_server.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_server.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_server.erl')
-rw-r--r--lib/kernel/src/logger_server.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/kernel/src/logger_server.erl b/lib/kernel/src/logger_server.erl
index 7df762053e..6d4ab0925d 100644
--- a/lib/kernel/src/logger_server.erl
+++ b/lib/kernel/src/logger_server.erl
@@ -107,10 +107,9 @@ cache_module_level(Module) ->
set_config(Owner,Key,Value) ->
update_config(Owner,#{Key=>Value}).
-set_config(Owner,Config0) ->
- case sanity_check(Owner,Config0) of
+set_config(Owner,Config) ->
+ case sanity_check(Owner,Config) of
ok ->
- Config = maps:merge(default_config(Owner),Config0),
call({set_config,Owner,Config});
Error ->
Error
@@ -215,13 +214,15 @@ handle_call({update_config,Id,NewConfig}, From, #state{tid=Tid}=State) ->
Error ->
{reply,Error,State}
end;
-handle_call({set_config,primary,Config}, _From, #state{tid=Tid}=State) ->
+handle_call({set_config,primary,Config0}, _From, #state{tid=Tid}=State) ->
+ Config = maps:merge(default_config(primary),Config0),
{ok,#{handlers:=Handlers}} = logger_config:get(Tid,primary),
Reply = do_set_config(Tid,primary,Config#{handlers=>Handlers}),
{reply,Reply,State};
-handle_call({set_config,HandlerId,Config}, From, #state{tid=Tid}=State) ->
+handle_call({set_config,HandlerId,Config0}, From, #state{tid=Tid}=State) ->
case logger_config:get(Tid,HandlerId) of
{ok,{Module,OldConfig}} ->
+ Config = maps:merge(default_config(HandlerId,Module),Config0),
call_h_async(
fun() ->
call_h(Module,changing_config,[OldConfig,Config],