aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger_std_h.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-09-17 12:45:07 +0200
committerSiri Hansen <[email protected]>2018-09-17 12:45:07 +0200
commit926bfd6f0bd71a8942f268cf23a37b55776600d2 (patch)
tree0f8d6c9101815eb4245035dd5e43cb93676b8fdd /lib/kernel/src/logger_std_h.erl
parent3a33f5ffe2d130789a7ebc45df75dbb56988016e (diff)
parent6073d37a5a0691704d0fa1a5ff9289ba9e35c8ed (diff)
downloadotp-926bfd6f0bd71a8942f268cf23a37b55776600d2.tar.gz
otp-926bfd6f0bd71a8942f268cf23a37b55776600d2.tar.bz2
otp-926bfd6f0bd71a8942f268cf23a37b55776600d2.zip
Merge branch 'siri/logger/post-21-continues/OTP-15132' into maint
* siri/logger/post-21-continues/OTP-15132: [logger] Read config before terminating handler process [error_logger] Handle report_cb with arity 2 [proc_lib] Improve crash reports for single line logging [logger] Include single_line option to report_cb [logger] Check for deadlock when removing filters [logger] Fix spec for handler callbacks to always return ok [logger] Increase timetrap timer for handler_requests_under_load test [logger] Improve code coverage in test [logger] Refactor, and add error detection for configuration [logger] Fix logger_disk_log_h_SUITE:sync and add som debug info [logger] Update doc about file options in logger_std_h [logger] Remove encoding option from logger_formatter Remove outdated reference to error loggers [logger] Refactor some logger internals
Diffstat (limited to 'lib/kernel/src/logger_std_h.erl')
-rw-r--r--lib/kernel/src/logger_std_h.erl10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/kernel/src/logger_std_h.erl b/lib/kernel/src/logger_std_h.erl
index 9a2a1443b3..66fa6b6ab6 100644
--- a/lib/kernel/src/logger_std_h.erl
+++ b/lib/kernel/src/logger_std_h.erl
@@ -210,7 +210,7 @@ removing_handler(#{id:=Name}) ->
%%%-----------------------------------------------------------------
%%% Log a string or report
--spec log(LogEvent, Config) -> ok | dropped when
+-spec log(LogEvent, Config) -> ok when
LogEvent :: logger:log_event(),
Config :: logger:handler_config().
@@ -259,7 +259,7 @@ init([Name, Config = #{config := HConfig},
mode_tab => ModeTab}},
proc_lib:init_ack({ok,self(),Config1}),
gen_server:cast(self(), repeated_filesync),
- enter_loop(Config1, State1)
+ gen_server:enter_loop(?MODULE, [], State1)
catch
_:Error ->
unregister(RegName),
@@ -290,9 +290,6 @@ do_init(Name, Type) ->
Error
end.
-enter_loop(_Config,State) ->
- gen_server:enter_loop(?MODULE,[],State).
-
%% This is the synchronous log event.
handle_call({log, Bin}, _From, State) ->
{Result,State1} = do_log(Bin, call, State),
@@ -418,8 +415,9 @@ terminate(Reason, State = #{id:=Name, file_ctrl_pid:=FWPid,
false ->
ok
end,
+ ok = logger_h_common:stop_or_restart(Name, Reason, State),
unregister(?name_to_reg_name(?MODULE, Name)),
- logger_h_common:stop_or_restart(Name, Reason, State).
+ ok.
code_change(_OldVsn, State, _Extra) ->
{ok, State}.