aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger_simple.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-05-16 16:10:30 +0200
committerSiri Hansen <[email protected]>2018-05-23 10:39:14 +0200
commit8aa64c90ddd20ec0ca8cc5fe92a6124324c51da5 (patch)
tree4faf98823094ebca7ba9c4a82834956b1c77bd1e /lib/kernel/src/logger_simple.erl
parent58abc1e47e6f44c75ef8e86f973270c6e23e89f7 (diff)
downloadotp-8aa64c90ddd20ec0ca8cc5fe92a6124324c51da5.tar.gz
otp-8aa64c90ddd20ec0ca8cc5fe92a6124324c51da5.tar.bz2
otp-8aa64c90ddd20ec0ca8cc5fe92a6124324c51da5.zip
Use system_time instead of monotonic_time as timestamp in logger
Diffstat (limited to 'lib/kernel/src/logger_simple.erl')
-rw-r--r--lib/kernel/src/logger_simple.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/kernel/src/logger_simple.erl b/lib/kernel/src/logger_simple.erl
index 5272455a2d..c8cdf25887 100644
--- a/lib/kernel/src/logger_simple.erl
+++ b/lib/kernel/src/logger_simple.erl
@@ -70,7 +70,7 @@ log(#{msg:=_,meta:=#{time:=_}}=Log,_Config) ->
do_log(
#{level=>error,
msg=>{report,{error,simple_handler_process_dead}},
- meta=>#{time=>erlang:monotonic_time(microsecond)}}),
+ meta=>#{time=>erlang:system_time(microsecond)}}),
do_log(Log);
_ ->
?MODULE ! {log,Log}
@@ -126,7 +126,7 @@ drop_msg(0) ->
drop_msg(N) ->
[#{level=>info,
msg=>{"Simple handler buffer full, dropped ~w messages",[N]},
- meta=>#{time=>erlang:monotonic_time(microsecond)}}].
+ meta=>#{time=>erlang:system_time(microsecond)}}].
%%%-----------------------------------------------------------------
%%% Internal
@@ -141,8 +141,7 @@ do_log(#{msg:=Msg,meta:=#{time:=T}}) ->
display_date(T),
display(Msg).
-display_date(Timestamp0) when is_integer(Timestamp0) ->
- Timestamp = Timestamp0 + erlang:time_offset(microsecond),
+display_date(Timestamp) when is_integer(Timestamp) ->
Micro = Timestamp rem 1000000,
Sec = Timestamp div 1000000,
{{Y,Mo,D},{H,Mi,S}} = erlang:universaltime_to_localtime(