diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-09-23 15:17:20 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-09-23 15:17:20 +0300 |
commit | 5770946f03ba669ea867b787fbd546333a8a3814 (patch) | |
tree | 73a03717ac5d4c31e12b92c1aba3b407f3c5329c /src/ejabberd_c2s.erl | |
parent | Fix unicode formatting in ACME module (diff) |
Correctly handle unicode in log messages
Diffstat (limited to '')
-rw-r--r-- | src/ejabberd_c2s.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 22b723041..2d89197a3 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -268,7 +268,7 @@ reject_unauthenticated_packet(State, _Pkt) -> process_auth_result(#{sasl_mech := Mech, auth_module := AuthModule, socket := Socket, ip := IP, lserver := LServer} = State, true, User) -> - ?INFO_MSG("(~s) Accepted c2s ~s authentication for ~s@~s by ~s backend from ~s", + ?INFO_MSG("(~ts) Accepted c2s ~ts authentication for ~ts@~ts by ~ts backend from ~ts", [xmpp_socket:pp(Socket), Mech, User, LServer, ejabberd_auth:backend_type(AuthModule), ejabberd_config:may_hide_data(misc:ip_to_list(IP))]), @@ -276,7 +276,7 @@ process_auth_result(#{sasl_mech := Mech, auth_module := AuthModule, process_auth_result(#{sasl_mech := Mech, socket := Socket, ip := IP, lserver := LServer} = State, {false, Reason}, User) -> - ?WARNING_MSG("(~s) Failed c2s ~s authentication ~sfrom ~s: ~s", + ?WARNING_MSG("(~ts) Failed c2s ~ts authentication ~tsfrom ~ts: ~ts", [xmpp_socket:pp(Socket), Mech, if User /= <<"">> -> ["for ", User, "@", LServer, " "]; true -> "" @@ -291,7 +291,7 @@ process_terminated(#{sid := SID, socket := Socket, jid := JID, user := U, server := S, resource := R} = State, Reason) -> Status = format_reason(State, Reason), - ?INFO_MSG("(~s) Closing c2s session for ~s: ~s", + ?INFO_MSG("(~ts) Closing c2s session for ~ts: ~ts", [xmpp_socket:pp(Socket), jid:encode(JID), Status]), State1 = case maps:is_key(pres_last, State) of true -> @@ -309,7 +309,7 @@ process_terminated(#{sid := SID, socket := Socket, State1; process_terminated(#{socket := Socket, stop_reason := {tls, _}} = State, Reason) -> - ?WARNING_MSG("(~s) Failed to secure c2s connection: ~s", + ?WARNING_MSG("(~ts) Failed to secure c2s connection: ~ts", [xmpp_socket:pp(Socket), format_reason(State, Reason)]), State; process_terminated(State, _Reason) -> @@ -431,12 +431,12 @@ bind(R, #{user := U, server := S, access := Access, lang := Lang, sid => ejabberd_sm:make_sid()}), State2 = ejabberd_hooks:run_fold( c2s_session_opened, LServer, State1, []), - ?INFO_MSG("(~s) Opened c2s session for ~s", + ?INFO_MSG("(~ts) Opened c2s session for ~ts", [xmpp_socket:pp(Socket), jid:encode(JID)]), {ok, State2}; deny -> ejabberd_hooks:run(forbidden_session_hook, LServer, [JID]), - ?WARNING_MSG("(~s) Forbidden c2s session for ~s", + ?WARNING_MSG("(~ts) Forbidden c2s session for ~ts", [xmpp_socket:pp(Socket), jid:encode(JID)]), Txt = ?T("Access denied by service policy"), {error, xmpp:err_not_allowed(Txt, Lang), State} @@ -894,7 +894,7 @@ bounce_message_queue({_, Pid} = SID, JID) -> SIDs = ejabberd_sm:get_session_sids(U, S, R), case lists:member(SID, SIDs) of true -> - ?WARNING_MSG("The session for ~s@~s/~s is supposed to " + ?WARNING_MSG("The session for ~ts@~ts/~ts is supposed to " "be unregistered, but session identifier ~p " "still presents in the 'session' table", [U, S, R, Pid]); |