aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-09-03 14:11:08 +0200
committerBjörn Gustavsson <[email protected]>2010-09-03 14:14:36 +0200
commitec806e4ac537b48241530a397b839117b75708dc (patch)
treee83eaa4f784061e58dffd5bf4ad2668183712ee5 /lib
parent8f67f51105560f1c0e721117100cf20d0c6061c0 (diff)
parent4d18f18a1d7ef4d0eca68aa1e5d7fe8a0cb4289d (diff)
downloadotp-ec806e4ac537b48241530a397b839117b75708dc.tar.gz
otp-ec806e4ac537b48241530a397b839117b75708dc.tar.bz2
otp-ec806e4ac537b48241530a397b839117b75708dc.zip
Merge branch 'tj/ct-timestamp-granularity' into dev
* tj/ct-timestamp-granularity: Include milliseconds in timestamps in Common Test log entries OTP-8808
Diffstat (limited to 'lib')
-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