aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-11-03 12:34:55 +0100
committerSiri Hansen <[email protected]>2014-11-27 12:14:45 +0100
commitfbe57ae10df43ea6015bac649ca5d72eb9b9e440 (patch)
treefbc2f6939e190a03a76373a3cd5a34ed16682ba8 /lib
parentcc3200e4010e994529af659d41057e6587f36079 (diff)
downloadotp-fbe57ae10df43ea6015bac649ca5d72eb9b9e440.tar.gz
otp-fbe57ae10df43ea6015bac649ca5d72eb9b9e440.tar.bz2
otp-fbe57ae10df43ea6015bac649ca5d72eb9b9e440.zip
[ct_telnet] Add timestamp to telnet_server debug printout
This is the telnet server used when testing ct_telnet and friends. The telnet client itself is not changed.
Diffstat (limited to 'lib')
-rw-r--r--lib/common_test/test/telnet_server.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/common_test/test/telnet_server.erl b/lib/common_test/test/telnet_server.erl
index 0a23a66324..d25ee62d38 100644
--- a/lib/common_test/test/telnet_server.erl
+++ b/lib/common_test/test/telnet_server.erl
@@ -310,4 +310,14 @@ get_line([],_) ->
dbg(_F) ->
dbg(_F,[]).
dbg(_F,_A) ->
- io:format("[telnet_server] " ++ _F,_A).
+ TS = timestamp(),
+ io:format("[telnet_server, ~s]\n" ++ _F,[TS|_A]).
+
+timestamp() ->
+ {MS,S,US} = now(),
+ {{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])).