aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorTomas Johansson <[email protected]>2010-07-13 15:53:52 +0200
committerTomas Johansson <[email protected]>2010-07-13 15:53:52 +0200
commit4d18f18a1d7ef4d0eca68aa1e5d7fe8a0cb4289d (patch)
treed6c37f4652909c7b02dd5fd9d0d5e33f9932ba53 /lib/common_test
parentc4b4edaaf03ac12e12080cb4a3768edbb6ecf77d (diff)
downloadotp-4d18f18a1d7ef4d0eca68aa1e5d7fe8a0cb4289d.tar.gz
otp-4d18f18a1d7ef4d0eca68aa1e5d7fe8a0cb4289d.tar.bz2
otp-4d18f18a1d7ef4d0eca68aa1e5d7fe8a0cb4289d.zip
Include milliseconds in timestamps in Common Test log entries
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_logs.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index f8ae7202e6..3684ff462f 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -384,11 +384,14 @@ maybe_log_timestamp() ->
[{"<i>~s</i>",[log_timestamp({MS,S,US})]}]})
end.
-log_timestamp(Now) ->
- put(log_timestamp,Now),
- {_,{H,M,S}} = calendar:now_to_local_time(Now),
- lists:flatten(io_lib:format("~2.2.0w:~2.2.0w:~2.2.0w",
- [H,M,S])).
+log_timestamp({MS,S,US}) ->
+ put(log_timestamp, {MS,S,US}),
+ {{Year,Month,Day}, {Hour,Min,Sec}} =
+ calendar:now_to_local_time({MS,S,US}),
+ MilliSec = trunc(US/1000),
+ lists:flatten(io_lib:format("~4.10.0B-~2.10.0B-~2.10.0B "
+ "~2.10.0B:~2.10.0B:~2.10.0B.~3.10.0B",
+ [Year,Month,Day,Hour,Min,Sec,MilliSec])).
%%%-----------------------------------------------------------------
%%% The logger server