diff options
author | Erlang/OTP <[email protected]> | 2012-01-17 16:38:40 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2012-01-17 16:38:40 +0100 |
commit | 5790c87a3c155dbe49b82a8f3b3b74f9fec9d71d (patch) | |
tree | e6aa27199150bfcac01cae6ef55d533a551a3ce4 /lib/snmp/test/snmp_test_lib.erl | |
parent | f3675ad3cbb3915b450311b202bea2118fca3d37 (diff) | |
parent | 531d9e60f84192da2e163077d062f5ec8027a78c (diff) | |
download | otp-5790c87a3c155dbe49b82a8f3b3b74f9fec9d71d.tar.gz otp-5790c87a3c155dbe49b82a8f3b3b74f9fec9d71d.tar.bz2 otp-5790c87a3c155dbe49b82a8f3b3b74f9fec9d71d.zip |
Merge branch 'bmk/snmp/snmp4215_integration/r15' into maint-r15
* bmk/snmp/snmp4215_integration/r15:
[snmp] Fixed release notes. Used wrong ticket number
[snmp/agent] Updated appup file
[snmp/agent] Updated release notes
[snmp/agent] Removed the (unused) serializer part
[snmp/agent] Use unique temporary file name during vacm table dumnping
[snmp/agent] Add common timestamp format function.
[snmp/agent] Synchronization feature added
[snmp/agent] Creating a unique temporary file whe dumping vacm
[snmp/agent] Changed version
[snmp/agent] Found another old-style fun (2-tuple)
[snmp/agent] Removed use of old style tuple funs
Diffstat (limited to 'lib/snmp/test/snmp_test_lib.erl')
-rw-r--r-- | lib/snmp/test/snmp_test_lib.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/snmp/test/snmp_test_lib.erl b/lib/snmp/test/snmp_test_lib.erl index 54839d989b..e4d58a1253 100644 --- a/lib/snmp/test/snmp_test_lib.erl +++ b/lib/snmp/test/snmp_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,7 +37,7 @@ -export([watchdog/3, watchdog_start/1, watchdog_start/2, watchdog_stop/1]). -export([del_dir/1]). -export([cover/1]). --export([p/2, print/5]). +-export([p/2, print/5, formated_timestamp/0]). %% ---------------------------------------------------------------------- @@ -521,15 +521,18 @@ p(F, A) when is_list(F) andalso is_list(A) -> print(Prefix, Module, Line, Format, Args) -> io:format("*** [~s] ~s ~p ~p ~p:~p *** " ++ Format ++ "~n", - [format_timestamp(now()), + [formated_timestamp(), Prefix, node(), self(), Module, Line|Args]). +formated_timestamp() -> + format_timestamp(os:timestamp()). + format_timestamp({_N1, _N2, N3} = Now) -> {Date, Time} = calendar:now_to_datetime(Now), {YYYY,MM,DD} = Date, {Hour,Min,Sec} = Time, FormatDate = - io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w 4~w", + io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w ~w", [YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]), lists:flatten(FormatDate). |