diff options
author | Erland Schönbeck <[email protected]> | 2015-03-25 12:55:19 +0100 |
---|---|---|
committer | Erland Schönbeck <[email protected]> | 2015-03-25 12:55:19 +0100 |
commit | d6797e9a34df677e82db5ee8b8388fbdf57f09f5 (patch) | |
tree | 1229a0acce281d4185d1ffcea44569947c31009c /lib/inets/src/tftp/tftp_logger.erl | |
parent | a206e66f13471cdad02a966fcb569673e0938fa4 (diff) | |
parent | e10385909c687590d6522d007bba9d72f3f5c380 (diff) | |
download | otp-d6797e9a34df677e82db5ee8b8388fbdf57f09f5.tar.gz otp-d6797e9a34df677e82db5ee8b8388fbdf57f09f5.tar.bz2 otp-d6797e9a34df677e82db5ee8b8388fbdf57f09f5.zip |
Merge branch 'erland/OTP18/inets/time_api/OTP-12441'
* erland/OTP18/inets/time_api/OTP-12441:
inets: Add new module inets_time_compat with new time API The new module is backwards compatible.
Diffstat (limited to 'lib/inets/src/tftp/tftp_logger.erl')
-rw-r--r-- | lib/inets/src/tftp/tftp_logger.erl | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/inets/src/tftp/tftp_logger.erl b/lib/inets/src/tftp/tftp_logger.erl index 104d6a91c6..231a705371 100644 --- a/lib/inets/src/tftp/tftp_logger.erl +++ b/lib/inets/src/tftp/tftp_logger.erl @@ -18,7 +18,6 @@ %% %% -module(tftp_logger). --compile([{nowarn_deprecated_function,{erlang,now,0}}]). %%------------------------------------------------------------------- %% Interface @@ -85,14 +84,8 @@ info_msg(Format, Data) -> %%------------------------------------------------------------------- add_timestamp(Format, Data) -> - %% Adapt to new OTP 18 erlang time API and be backwards compatible - Now = try - erlang:timestamp() - catch - error:undef -> - erlang:now() - end, - {{_Y, _Mo, _D}, {H, Mi, S}} = calendar:now_to_universal_time(Now), + Time = inets_time_compat:timestamp(), + {{_Y, _Mo, _D}, {H, Mi, S}} = calendar:now_to_universal_time(Time), %% {"~p-~s-~sT~s:~s:~sZ,~6.6.0w tftp: " ++ Format ++ "\n", %% [Y, t(Mo), t(D), t(H), t(Mi), t(S), MicroSecs | Data]}. {"~s:~s:~s tftp: " ++ Format, [t(H), t(Mi), t(S) | Data]}. |