aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger_server.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-05-21 17:45:21 +0200
committerSiri Hansen <[email protected]>2018-05-23 11:11:57 +0200
commitf38163aa64547e09f99e362edefeda713e06ddb7 (patch)
treeb23ea05501d4410b1a75812b98ae455b3623d7a7 /lib/kernel/src/logger_server.erl
parentca1bf7a9d915a973203aa046bb9f921c11681ee0 (diff)
downloadotp-f38163aa64547e09f99e362edefeda713e06ddb7.tar.gz
otp-f38163aa64547e09f99e362edefeda713e06ddb7.tar.bz2
otp-f38163aa64547e09f99e362edefeda713e06ddb7.zip
Remove HandlerId from handler callback functions and add it to Config
Diffstat (limited to 'lib/kernel/src/logger_server.erl')
-rw-r--r--lib/kernel/src/logger_server.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/kernel/src/logger_server.erl b/lib/kernel/src/logger_server.erl
index 16f61abdd6..9182b0b486 100644
--- a/lib/kernel/src/logger_server.erl
+++ b/lib/kernel/src/logger_server.erl
@@ -134,7 +134,7 @@ init([]) ->
filters=>?DEFAULT_HANDLER_FILTERS}),
%% If this fails, then the node should crash
{ok,SimpleConfig} =
- logger_simple:adding_handler(logger_simple,SimpleConfig0),
+ logger_simple:adding_handler(SimpleConfig0),
logger_config:create(Tid,logger_simple,logger_simple,SimpleConfig),
{ok, #state{tid=Tid, async_req_queue = queue:new()}}.
@@ -146,7 +146,7 @@ handle_call({add_handler,Id,Module,HConfig}, From, #state{tid=Tid}=State) ->
call_h_async(
fun() ->
%% inform the handler
- call_h(Module,adding_handler,[Id,HConfig],{ok,HConfig})
+ call_h(Module,adding_handler,[HConfig],{ok,HConfig})
end,
fun({ok,HConfig1}) ->
%% We know that the call_h would have loaded the module
@@ -177,7 +177,7 @@ handle_call({remove_handler,HandlerId}, From, #state{tid=Tid}=State) ->
call_h_async(
fun() ->
%% inform the handler
- call_h(Module,removing_handler,[HandlerId,HConfig],ok)
+ call_h(Module,removing_handler,[HConfig],ok)
end,
fun(_Res) ->
do_set_config(Tid,logger,Config#{handlers=>Handlers}),
@@ -213,7 +213,7 @@ handle_call({set_config,HandlerId,Config}, From, #state{tid=Tid}=State) ->
{ok,{Module,OldConfig}} ->
call_h_async(
fun() ->
- call_h(Module,changing_config,[HandlerId,OldConfig,Config],
+ call_h(Module,changing_config,[OldConfig,Config],
{ok,Config})
end,
fun({ok,Config1}) ->
@@ -348,8 +348,9 @@ default_config(logger) ->
#{level=>info,
filters=>[],
filter_default=>log};
-default_config(_) ->
- #{level=>info,
+default_config(Id) ->
+ #{id=>Id,
+ level=>info,
filters=>[],
filter_default=>log,
formatter=>{?DEFAULT_FORMATTER,#{}}}.