diff options
author | Hans Nilsson <[email protected]> | 2019-06-28 12:05:54 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2019-06-28 14:44:15 +0200 |
commit | 5686bebd81b3055e5c688e1544798b8c0fab426c (patch) | |
tree | 1099b76e26938e5a2c8488ace24663cb75ddd450 | |
parent | d7a20eadc8a79e22a38c2a07c0a15dc9c0c2935c (diff) | |
download | otp-5686bebd81b3055e5c688e1544798b8c0fab426c.tar.gz otp-5686bebd81b3055e5c688e1544798b8c0fab426c.tar.bz2 otp-5686bebd81b3055e5c688e1544798b8c0fab426c.zip |
ssh: added log/4
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index cd9991f381..9df4f1e2d7 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -1558,7 +1558,7 @@ terminate({shutdown,"Connection closed"}, _StateName, D) -> terminate({shutdown,{init,Reason}}, StateName, D) -> %% Error in initiation. "This error should not occur". - log(error, D, io_lib:format("Shutdown in init (StateName=~p): ~p~n",[StateName,Reason])), + log(error, D, "Shutdown in init (StateName=~p): ~p~n", [StateName,Reason]), stop_subsystem(D), close_transport(D); @@ -1960,12 +1960,12 @@ send_disconnect(Code, Reason, DetailedText, Module, Line, StateName, D0) -> call_disconnectfun_and_log_cond(LogMsg, DetailedText, Module, Line, StateName, D) -> case disconnect_fun(LogMsg, D) of void -> - log(info, D, - io_lib:format("~s~n" - "State = ~p~n" - "Module = ~p, Line = ~p.~n" - "Details:~n ~s~n", - [LogMsg, StateName, Module, Line, DetailedText])); + log(info, D, + "~s~n" + "State = ~p~n" + "Module = ~p, Line = ~p.~n" + "Details:~n ~s~n", + [LogMsg, StateName, Module, Line, DetailedText]); _ -> ok end. @@ -2029,6 +2029,9 @@ fold_keys(Keys, Fun, Extra) -> end, [], Keys). %%%---------------------------------------------------------------- +log(Tag, D, Format, Args) -> + log(Tag, D, io_lib:format(Format,Args)). + log(Tag, D, Reason) -> case atom_to_list(Tag) of % Dialyzer-technical reasons... "error" -> do_log(error_msg, Reason, D); |