aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
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/test
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/test')
-rw-r--r--lib/kernel/test/logger_SUITE.erl4
-rw-r--r--lib/kernel/test/logger_formatter_SUITE.erl5
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/kernel/test/logger_SUITE.erl b/lib/kernel/test/logger_SUITE.erl
index e602fa2576..1d3410e356 100644
--- a/lib/kernel/test/logger_SUITE.erl
+++ b/lib/kernel/test/logger_SUITE.erl
@@ -769,14 +769,14 @@ process_metadata(_Config) ->
undefined = logger:get_process_metadata(),
{error,badarg} = ?TRY(logger:set_process_metadata(bad)),
ok = logger:add_handler(h1,?MODULE,#{level=>info,filter_default=>log}),
- Time = erlang:monotonic_time(microsecond),
+ Time = erlang:system_time(microsecond),
ProcMeta = #{time=>Time,line=>0,custom=>proc},
ok = logger:set_process_metadata(ProcMeta),
S1 = ?str,
?LOG_INFO(S1,#{custom=>macro}),
check_logged(info,S1,#{time=>Time,line=>0,custom=>macro}),
- Time2 = erlang:monotonic_time(microsecond),
+ Time2 = erlang:system_time(microsecond),
S2 = ?str,
?LOG_INFO(S2,#{time=>Time2,line=>1,custom=>macro}),
check_logged(info,S2,#{time=>Time2,line=>1,custom=>macro}),
diff --git a/lib/kernel/test/logger_formatter_SUITE.erl b/lib/kernel/test/logger_formatter_SUITE.erl
index 9baadfd65a..c171165944 100644
--- a/lib/kernel/test/logger_formatter_SUITE.erl
+++ b/lib/kernel/test/logger_formatter_SUITE.erl
@@ -546,8 +546,7 @@ default_time_format(Timestamp) ->
default_time_format(Timestamp,Utc) ->
default_time_format(Timestamp,Utc,$T).
-default_time_format(Timestamp0,Utc,Sep) ->
- Timestamp=Timestamp0+erlang:time_offset(microsecond),
+default_time_format(Timestamp,Utc,Sep) ->
Offset = if Utc -> "Z";
true -> ""
end,
@@ -569,7 +568,7 @@ my_try(Fun) ->
try Fun() catch C:R:S -> {C,R,hd(S)} end.
timestamp() ->
- erlang:monotonic_time(microsecond).
+ erlang:system_time(microsecond).
%% necessary?
add_time(#{time:=_}=Meta) ->