From a3e0cbbdd8a3ec4bbfa17e5147c59978021fc0b5 Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Mon, 24 Jun 2019 20:32:34 +0300 Subject: [PATCH] Make logging messages more consistent --- src/ejabberd_acme.erl | 4 ++-- src/ejabberd_acme_comm.erl | 2 +- src/ejabberd_auth.erl | 2 +- src/ejabberd_bosh.erl | 22 ++++++++++---------- src/ejabberd_c2s.erl | 4 ++-- src/ejabberd_captcha.erl | 2 +- src/ejabberd_iq.erl | 4 ++-- src/ejabberd_local.erl | 6 +++--- src/ejabberd_mnesia.erl | 2 +- src/ejabberd_oauth_rest.erl | 2 +- src/ejabberd_redis.erl | 10 ++++----- src/ejabberd_riak.erl | 4 ++-- src/ejabberd_router.erl | 8 ++++---- src/ejabberd_router_mnesia.erl | 2 +- src/ejabberd_router_multicast.erl | 2 +- src/ejabberd_router_redis.erl | 2 +- src/ejabberd_router_riak.erl | 2 +- src/ejabberd_router_sql.erl | 4 ++-- src/ejabberd_s2s.erl | 8 ++++---- src/ejabberd_s2s_in.erl | 4 ++-- src/ejabberd_s2s_out.erl | 4 ++-- src/ejabberd_sm.erl | 32 ++++++++++++++--------------- src/ejabberd_sm_redis.erl | 4 ++-- src/ejabberd_sm_sql.erl | 2 +- src/ejabberd_sql.erl | 26 +++++++++++------------ src/ejabberd_sql_sup.erl | 2 +- src/ejabberd_update.erl | 34 +++++++++++++++---------------- src/ejabberd_web_admin.erl | 2 +- src/ejabberd_websocket.erl | 12 +++++------ src/ejabberd_xmlrpc.erl | 4 ++-- src/ejd2sql.erl | 2 +- src/eldap.erl | 34 +++++++++++++++---------------- src/gen_iq_handler.erl | 2 +- src/jd2ejd.erl | 4 ++-- src/mod_admin_extra.erl | 2 +- src/mod_announce.erl | 10 ++++----- src/mod_announce_sql.erl | 2 +- src/mod_avatar.erl | 20 +++++++++--------- src/mod_bosh_mnesia.erl | 2 +- src/mod_bosh_redis.erl | 6 +++--- src/mod_bosh_riak.erl | 2 +- src/mod_bosh_sql.erl | 2 +- src/mod_caps.erl | 2 +- src/mod_delegation.erl | 4 ++-- src/mod_fail2ban.erl | 6 +++--- src/mod_http_api.erl | 4 ++-- src/mod_http_fileserver.erl | 4 ++-- src/mod_http_upload.erl | 8 ++++---- src/mod_http_upload_quota.erl | 6 +++--- src/mod_metrics.erl | 2 +- src/mod_mqtt_session.erl | 10 ++++----- src/mod_mqtt_ws.erl | 6 +++--- src/mod_muc.erl | 4 ++-- src/mod_muc_log.erl | 2 +- src/mod_muc_mnesia.erl | 2 +- src/mod_muc_room.erl | 2 +- src/mod_muc_sql.erl | 4 ++-- src/mod_multicast.erl | 2 +- src/mod_offline.erl | 4 ++-- src/mod_offline_sql.erl | 8 ++++---- src/mod_ping.erl | 2 +- src/mod_privacy_sql.erl | 2 +- src/mod_private_sql.erl | 2 +- src/mod_proxy65_redis.erl | 6 +++--- src/mod_proxy65_service.erl | 4 ++-- src/mod_proxy65_sql.erl | 2 +- src/mod_pubsub.erl | 18 ++++++++-------- src/mod_register.erl | 5 ++--- src/mod_register_web.erl | 2 +- src/mod_roster.erl | 4 ++-- src/mod_shared_roster.erl | 2 +- src/mod_sip.erl | 2 +- src/mod_sip_registrar.erl | 4 ++-- src/mod_stream_mgmt.erl | 2 +- src/mod_vcard.erl | 6 +++--- src/prosody2ejabberd.erl | 14 ++++++------- 76 files changed, 231 insertions(+), 232 deletions(-) diff --git a/src/ejabberd_acme.erl b/src/ejabberd_acme.erl index cae6b71be..95e54c520 100644 --- a/src/ejabberd_acme.erl +++ b/src/ejabberd_acme.erl @@ -54,11 +54,11 @@ handle_call(_Request, _From, State) -> {stop, {unexpected_call, _Request, _From}, State}. handle_cast(_Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [_Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [_Msg]), {noreply, State}. handle_info(_Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [_Info]), + ?WARNING_MSG("Unexpected info: ~p", [_Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/ejabberd_acme_comm.erl b/src/ejabberd_acme_comm.erl index 2a3efd543..1f5bdda86 100644 --- a/src/ejabberd_acme_comm.erl +++ b/src/ejabberd_acme_comm.erl @@ -398,7 +398,7 @@ decode(Json) -> -spec failed_http_request({ok, _} | {error, _}, url()) -> {error, _}. failed_http_request({ok, {{_, Code, Reason}, _Head, Body}}, Url) -> - ?ERROR_MSG("Got unexpected status code from <~s>: ~B, Body: ~s", + ?ERROR_MSG("Unexpected status code from <~s>: ~B, Body: ~s", [Url, Code, Body]), throw({error, {unexpected_code, Code, Reason}}); failed_http_request({error, Reason}, Url) -> diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 389e65d85..33e0d118f 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -144,7 +144,7 @@ handle_cast(config_reloaded, #state{host_modules = HostModules} = State) -> init_cache(NewHostModules), {noreply, State#state{host_modules = NewHostModules}}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(_Info, State) -> diff --git a/src/ejabberd_bosh.erl b/src/ejabberd_bosh.erl index 14a0feb29..73a82ab66 100644 --- a/src/ejabberd_bosh.erl +++ b/src/ejabberd_bosh.erl @@ -309,14 +309,14 @@ init([#body{attrs = Attrs}, IP, SID]) -> end. wait_for_session(_Event, State) -> - ?ERROR_MSG("unexpected event in 'wait_for_session': ~p", + ?ERROR_MSG("Unexpected event in 'wait_for_session': ~p", [_Event]), {next_state, wait_for_session, State}. wait_for_session(#body{attrs = Attrs} = Req, From, State) -> RID = get_attr(rid, Attrs), - ?DEBUG("got request:~n** RequestID: ~p~n** Request: " + ?DEBUG("Got request:~n** RequestID: ~p~n** Request: " "~p~n** From: ~p~n** State: ~p", [RID, Req, From, State]), Wait = min(get_attr(wait, Attrs, undefined), @@ -368,20 +368,20 @@ wait_for_session(#body{attrs = Attrs} = Req, From, From) end; wait_for_session(_Event, _From, State) -> - ?ERROR_MSG("unexpected sync event in 'wait_for_session': ~p", + ?ERROR_MSG("Unexpected sync event in 'wait_for_session': ~p", [_Event]), {reply, {error, badarg}, wait_for_session, State}. active({#body{} = Body, From}, State) -> active1(Body, From, State); active(_Event, State) -> - ?ERROR_MSG("unexpected event in 'active': ~p", + ?ERROR_MSG("Unexpected event in 'active': ~p", [_Event]), {next_state, active, State}. active(#body{attrs = Attrs, size = Size} = Req, From, State) -> - ?DEBUG("got request:~n** Request: ~p~n** From: " + ?DEBUG("Got request:~n** Request: ~p~n** From: " "~p~n** State: ~p", [Req, From, State]), {ShaperState, Pause} = @@ -409,7 +409,7 @@ active(#body{attrs = Attrs, size = Size} = Req, From, true -> active1(Req, From, State1) end; active(_Event, _From, State) -> - ?ERROR_MSG("unexpected sync event in 'active': ~p", + ?ERROR_MSG("Unexpected sync event in 'active': ~p", [_Event]), {reply, {error, badarg}, active, State}. @@ -518,7 +518,7 @@ handle_event({change_shaper, Shaper}, StateName, State) -> {next_state, StateName, State#state{shaper_state = Shaper}}; handle_event(_Event, StateName, State) -> - ?ERROR_MSG("unexpected event in '~s': ~p", + ?ERROR_MSG("Unexpected event in '~s': ~p", [StateName, _Event]), {next_state, StateName, State}. @@ -558,7 +558,7 @@ handle_sync_event(deactivate_socket, _From, StateName, {reply, ok, StateName, StateData#state{c2s_pid = undefined}}; handle_sync_event(_Event, _From, StateName, State) -> - ?ERROR_MSG("unexpected sync event in '~s': ~p", + ?ERROR_MSG("Unexpected sync event in '~s': ~p", [StateName, _Event]), {reply, {error, badarg}, StateName, State}. @@ -584,7 +584,7 @@ handle_info({timeout, TRef, shaper_timeout}, StateName, _ -> {next_state, StateName, State} end; handle_info(_Info, StateName, State) -> - ?ERROR_MSG("unexpected info:~n** Msg: ~p~n** StateName: ~p", + ?ERROR_MSG("Unexpected info:~n** Msg: ~p~n** StateName: ~p", [_Info, StateName]), {next_state, StateName, State}. @@ -676,7 +676,7 @@ drop_holding_receiver(State, RID) -> end. do_reply(State, From, Body, RID) -> - ?DEBUG("send reply:~n** RequestID: ~p~n** Reply: " + ?DEBUG("Send reply:~n** RequestID: ~p~n** Reply: " "~p~n** To: ~p~n** State: ~p", [RID, Body, From, State]), p1_fsm:reply(From, Body), @@ -949,7 +949,7 @@ bosh_response(Body, Type) -> encode_body(Body, Type)}. bosh_response_with_msg(Body, Type, RcvBody) -> - ?DEBUG("send error reply:~p~n** Receiced body: ~p", + ?DEBUG("Send error reply:~p~n** Receiced body: ~p", [Body, RcvBody]), bosh_response(Body, Type). diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 63c36263f..3f5b3aa0c 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -248,11 +248,11 @@ process_info(#{jid := JID} = State, {resend_presence, To}) -> process_presence_out(State, xmpp:set_to(Pres, To)) end; process_info(State, Info) -> - ?WARNING_MSG("got unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), State. handle_unexpected_cast(State, Msg) -> - ?WARNING_MSG("got unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), State. reject_unauthenticated_packet(State, _Pkt) -> diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index 2271a3bf9..cd07709ab 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -345,7 +345,7 @@ handle_call(_Request, _From, State) -> handle_cast(_Msg, State) -> {noreply, State}. handle_info({remove_id, Id}, State) -> - ?DEBUG("captcha ~p timed out", [Id]), + ?DEBUG("CAPTCHA ~p timed out", [Id]), case ets:lookup(captcha, Id) of [#captcha{args = Args, pid = Pid}] -> callback(captcha_failed, Pid, Args), diff --git a/src/ejabberd_iq.erl b/src/ejabberd_iq.erl index 4de88afa1..cda5b57c9 100644 --- a/src/ejabberd_iq.erl +++ b/src/ejabberd_iq.erl @@ -80,7 +80,7 @@ handle_cast({restart_timer, Expire}, State) -> State1 = State#state{expire = min(Expire, State#state.expire)}, noreply(State1); handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), noreply(State). handle_info({route, IQ, Key}, State) -> @@ -96,7 +96,7 @@ handle_info(timeout, State) -> Expire = clean(ets:first(?MODULE)), noreply(State#state{expire = Expire}); handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), noreply(State). terminate(_Reason, _State) -> diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index 6b530ec1b..9cc3cc123 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -73,7 +73,7 @@ start_link() -> route(Packet) -> try do_route(Packet) catch ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to route packet:~n~s~nReason = ~p", + ?ERROR_MSG("Failed to route packet:~n~s~nReason = ~p", [xmpp:pp(Packet), {E, {R, ?EX_STACK(St)}}]) end. @@ -123,7 +123,7 @@ handle_info({route, Packet}, State) -> route(Packet), {noreply, State}; handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> @@ -140,7 +140,7 @@ code_change(_OldVsn, State, _Extra) -> %%-------------------------------------------------------------------- -spec do_route(stanza()) -> any(). do_route(Packet) -> - ?DEBUG("local route:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Local route:~n~s", [xmpp:pp(Packet)]), Type = xmpp:get_type(Packet), To = xmpp:get_to(Packet), if To#jid.luser /= <<"">> -> diff --git a/src/ejabberd_mnesia.erl b/src/ejabberd_mnesia.erl index 3ccf6af89..c5fb7ab6d 100644 --- a/src/ejabberd_mnesia.erl +++ b/src/ejabberd_mnesia.erl @@ -438,7 +438,7 @@ mnesia_op(Fun, Args) -> {atomic, ok} -> {atomic, ok}; Other -> - ?ERROR_MSG("failure on mnesia ~s ~p: ~p", + ?ERROR_MSG("Failure on mnesia ~s ~p: ~p", [Fun, Args, Other]), Other end. diff --git a/src/ejabberd_oauth_rest.erl b/src/ejabberd_oauth_rest.erl index 793e928b3..8ebfecf5a 100644 --- a/src/ejabberd_oauth_rest.erl +++ b/src/ejabberd_oauth_rest.erl @@ -56,7 +56,7 @@ store(R) -> {ok, Code, _} when Code == 200 orelse Code == 201 -> ok; Err -> - ?ERROR_MSG("failed to store oauth record ~p: ~p", [R, Err]), + ?ERROR_MSG("Failed to store oauth record ~p: ~p", [R, Err]), {error, db_failure} end. diff --git a/src/ejabberd_redis.erl b/src/ejabberd_redis.erl index 55e9dfcff..29a8947ec 100644 --- a/src/ejabberd_redis.erl +++ b/src/ejabberd_redis.erl @@ -390,7 +390,7 @@ handle_call({subscribe, Caller, Channels}, _From, eredis_subscribe(Pid, Channels), {reply, ok, State#state{subscriptions = Subs1}}; handle_call(Request, _From, State) -> - ?WARNING_MSG("unexepected call: ~p", [Request]), + ?WARNING_MSG("Unexepected call: ~p", [Request]), {noreply, State}. handle_cast(_Msg, State) -> @@ -423,7 +423,7 @@ handle_info({subscribed, Channel, Pid}, State) -> case maps:is_key(Channel, State#state.subscriptions) of true -> eredis_sub:ack_message(Pid); false -> - ?WARNING_MSG("got subscription ack for unknown channel ~s", + ?WARNING_MSG("Got subscription ack for unknown channel ~s", [Channel]) end; _ -> @@ -443,7 +443,7 @@ handle_info({message, Channel, Data, Pid}, State) -> end, {noreply, State}; handle_info(Info, State) -> - ?WARNING_MSG("unexpected info = ~p", [Info]), + ?WARNING_MSG("Unexpected info = ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> @@ -497,7 +497,7 @@ do_connect(_, Server, Port, Pass, DB, ConnTimeout) -> (pos_integer(), {qp, redis_pipeline()}, integer()) -> [{ok, redis_reply()} | redis_error()] | redis_error(). call(I, {F, Cmd}, Retries) -> - ?DEBUG("redis query: ~p", [Cmd]), + ?DEBUG("Redis query: ~p", [Cmd]), Conn = get_connection(I), Res = try eredis:F(Conn, Cmd, ?CALL_TIMEOUT) of {error, Reason} when is_atom(Reason) -> @@ -630,5 +630,5 @@ re_subscribe(Pid, Subs) -> end. eredis_subscribe(Pid, Channels) -> - ?DEBUG("redis query: ~p", [[<<"SUBSCRIBE">>|Channels]]), + ?DEBUG("Redis query: ~p", [[<<"SUBSCRIBE">>|Channels]]), eredis_sub:subscribe(Pid, Channels). diff --git a/src/ejabberd_riak.erl b/src/ejabberd_riak.erl index 5eadcc8ba..5bf783612 100644 --- a/src/ejabberd_riak.erl +++ b/src/ejabberd_riak.erl @@ -459,7 +459,7 @@ handle_cast(_Msg, State) -> handle_info({'DOWN', _MonitorRef, _Type, _Object, _Info}, State) -> {stop, normal, State}; handle_info(_Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [_Info]), + ?ERROR_MSG("Unexpected info: ~p", [_Info]), {noreply, State}. %% @private @@ -511,7 +511,7 @@ log_error({error, Why} = Err, Function, Opts) -> true -> io_lib:fwrite("** Error: ~p", [Err]) end, - ?ERROR_MSG("database error:~n** Function: ~p~n~s~s", + ?ERROR_MSG("Database error:~n** Function: ~p~n~s~s", [Function, Txt, ErrTxt]); log_error(_, _, _) -> ok. diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index 325dd75f3..c72b58126 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -90,7 +90,7 @@ start_link() -> route(Packet) -> try do_route(Packet) catch ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to route packet:~n~s~nReason = ~p", + ?ERROR_MSG("Failed to route packet:~n~s~nReason = ~p", [xmpp:pp(Packet), {E, {R, ?EX_STACK(St)}}]) end. @@ -99,7 +99,7 @@ route(#jid{} = From, #jid{} = To, #xmlel{} = El) -> try xmpp:decode(El, ?NS_CLIENT, [ignore_els]) of Pkt -> route(From, To, Pkt) catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode xml element ~p when " + ?ERROR_MSG("Failed to decode xml element ~p when " "routing from ~s to ~s: ~s", [El, jid:encode(From), jid:encode(To), xmpp:format_error(Why)]) @@ -334,7 +334,7 @@ handle_info({route, Packet}, State) -> route(Packet), {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> @@ -348,7 +348,7 @@ code_change(_OldVsn, State, _Extra) -> %%-------------------------------------------------------------------- -spec do_route(stanza()) -> ok. do_route(OrigPacket) -> - ?DEBUG("route:~n~s", [xmpp:pp(OrigPacket)]), + ?DEBUG("Route:~n~s", [xmpp:pp(OrigPacket)]), case ejabberd_hooks:run_fold(filter_packet, OrigPacket, []) of drop -> ok; diff --git a/src/ejabberd_router_mnesia.erl b/src/ejabberd_router_mnesia.erl index 329f5e061..cfca2f980 100644 --- a/src/ejabberd_router_mnesia.erl +++ b/src/ejabberd_router_mnesia.erl @@ -201,7 +201,7 @@ handle_info({'DOWN', _Ref, _Type, Pid, _Info}, State) -> transaction(F), {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/ejabberd_router_multicast.erl b/src/ejabberd_router_multicast.erl index 6dbaeb41a..463444add 100644 --- a/src/ejabberd_router_multicast.erl +++ b/src/ejabberd_router_multicast.erl @@ -209,7 +209,7 @@ code_change(_OldVsn, State, _Extra) -> %% Destinations = [#jid] -spec do_route(binary(), [jid()], stanza()) -> any(). do_route(Domain, Destinations, Packet) -> - ?DEBUG("route multicast:~n~s~nDomain: ~s~nDestinations: ~s~n", + ?DEBUG("Route multicast:~n~s~nDomain: ~s~nDestinations: ~s~n", [xmpp:pp(Packet), Domain, str:join([jid:encode(To) || To <- Destinations], <<", ">>)]), %% Try to find an appropriate multicast service diff --git a/src/ejabberd_router_redis.erl b/src/ejabberd_router_redis.erl index cafb05b13..3213901a6 100644 --- a/src/ejabberd_router_redis.erl +++ b/src/ejabberd_router_redis.erl @@ -139,7 +139,7 @@ handle_cast(_Msg, State) -> {noreply, State}. handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/ejabberd_router_riak.erl b/src/ejabberd_router_riak.erl index 434034cd9..3ff0b578c 100644 --- a/src/ejabberd_router_riak.erl +++ b/src/ejabberd_router_riak.erl @@ -78,6 +78,6 @@ clean_table() -> ejabberd_riak:delete(route, {Domain, Pid}) end, Routes); {error, Err} -> - ?ERROR_MSG("failed to clean Riak 'route' table: ~p", [Err]), + ?ERROR_MSG("Failed to clean Riak 'route' table: ~p", [Err]), Err end. diff --git a/src/ejabberd_router_sql.erl b/src/ejabberd_router_sql.erl index 940333d40..2dd7e0790 100644 --- a/src/ejabberd_router_sql.erl +++ b/src/ejabberd_router_sql.erl @@ -44,7 +44,7 @@ init() -> {updated, _} -> ok; Err -> - ?ERROR_MSG("failed to clean 'route' table: ~p", [Err]), + ?ERROR_MSG("Failed to clean 'route' table: ~p", [Err]), Err end. @@ -122,7 +122,7 @@ row_to_route(Domain, {ServerHost, NodeS, PidS, LocalHintS} = Row) -> catch _:{bad_node, _} -> []; ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to decode row from 'route' table:~n" + ?ERROR_MSG("Failed to decode row from 'route' table:~n" "Row = ~p~n" "Domain = ~s~n" "Reason = ~p", diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index f499e82c2..98adff4a1 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -91,7 +91,7 @@ start_link() -> route(Packet) -> try do_route(Packet) catch ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to route packet:~n~s~nReason = ~p", + ?ERROR_MSG("Failed to route packet:~n~s~nReason = ~p", [xmpp:pp(Packet), {E, {R, ?EX_STACK(St)}}]) end. @@ -348,12 +348,12 @@ clean_table_from_bad_node(Node) -> -spec do_route(stanza()) -> ok. do_route(Packet) -> - ?DEBUG("local route:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Local route:~n~s", [xmpp:pp(Packet)]), From = xmpp:get_from(Packet), To = xmpp:get_to(Packet), case start_connection(From, To) of {ok, Pid} when is_pid(Pid) -> - ?DEBUG("sending to process ~p~n", [Pid]), + ?DEBUG("Sending to process ~p~n", [Pid]), #jid{lserver = MyServer} = From, ejabberd_hooks:run(s2s_send_packet, MyServer, [Packet]), ejabberd_s2s_out:route(Pid, Packet); @@ -484,7 +484,7 @@ new_connection(MyServer, Server, From, FromTo, end, [Pid1]; {aborted, Reason} -> - ?ERROR_MSG("failed to register connection ~s -> ~s: ~p", + ?ERROR_MSG("Failed to register connection ~s -> ~s: ~p", [MyServer, Server, Reason]), ejabberd_s2s_out:stop(Pid), [] diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 4dbfbd70d..96cb93c25 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -112,11 +112,11 @@ host_down(Host) -> %%% Hooks %%%=================================================================== handle_unexpected_info(State, Info) -> - ?WARNING_MSG("got unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), State. handle_unexpected_cast(State, Msg) -> - ?WARNING_MSG("got unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), State. reject_unauthenticated_packet(State, _Pkt) -> diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 6f950841a..0741690d6 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -164,11 +164,11 @@ process_closed(#{server := LServer, remote_server := RServer} = State, xmpp_stream_out:set_timeout(State2, timer:seconds(Delay)). handle_unexpected_info(State, Info) -> - ?WARNING_MSG("got unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), State. handle_unexpected_cast(State, Msg) -> - ?WARNING_MSG("got unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), State. process_downgraded(State, _StreamStart) -> diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 69e8fcba2..47900e48f 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -126,7 +126,7 @@ stop() -> route(To, Term) -> case catch do_route(To, Term) of {'EXIT', Reason} -> - ?ERROR_MSG("route ~p to ~p failed: ~p", + ?ERROR_MSG("Route ~p to ~p failed: ~p", [Term, To, Reason]); _ -> ok @@ -137,11 +137,11 @@ route(Packet) -> #jid{lserver = LServer} = xmpp:get_to(Packet), case ejabberd_hooks:run_fold(sm_receive_packet, LServer, Packet, []) of drop -> - ?DEBUG("hook dropped stanza:~n~s", [xmpp:pp(Packet)]); + ?DEBUG("Hook dropped stanza:~n~s", [xmpp:pp(Packet)]); Packet1 -> try do_route(Packet1), ok catch ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to route packet:~n~s~nReason = ~p", + ?ERROR_MSG("Failed to route packet:~n~s~nReason = ~p", [xmpp:pp(Packet1), {E, {R, ?EX_STACK(St)}}]) end @@ -204,7 +204,7 @@ bounce_sm_packet({bounce, Packet} = Acc) -> ejabberd_router:route_error(Packet, Err), {stop, Acc}; bounce_sm_packet({_, Packet} = Acc) -> - ?DEBUG("dropping packet to unavailable resource:~n~s", + ?DEBUG("Dropping packet to unavailable resource:~n~s", [xmpp:pp(Packet)]), Acc. @@ -491,7 +491,7 @@ handle_info({route, Packet}, State) -> route(Packet), {noreply, State}; handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> @@ -633,23 +633,23 @@ do_route(#jid{lresource = <<"">>} = To, Term) -> do_route(jid:replace_resource(To, R), Term) end, get_user_resources(To#jid.user, To#jid.server)); do_route(To, Term) -> - ?DEBUG("broadcasting ~p to ~s", [Term, jid:encode(To)]), + ?DEBUG("Broadcasting ~p to ~s", [Term, jid:encode(To)]), {U, S, R} = jid:tolower(To), Mod = get_sm_backend(S), case get_sessions(Mod, U, S, R) of [] -> - ?DEBUG("dropping broadcast to unavailable resourse: ~p", [Term]); + ?DEBUG("Dropping broadcast to unavailable resourse: ~p", [Term]); Ss -> Session = lists:max(Ss), Pid = element(2, Session#session.sid), - ?DEBUG("sending to process ~p: ~p", [Pid, Term]), + ?DEBUG("Sending to process ~p: ~p", [Pid, Term]), ejabberd_c2s:route(Pid, Term) end. -spec do_route(stanza()) -> any(). do_route(#presence{to = To, type = T} = Packet) when T == subscribe; T == subscribed; T == unsubscribe; T == unsubscribed -> - ?DEBUG("processing subscription:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Processing subscription:~n~s", [xmpp:pp(Packet)]), #jid{luser = LUser, lserver = LServer} = To, case is_privacy_allow(Packet) andalso ejabberd_hooks:run_fold( @@ -662,7 +662,7 @@ do_route(#presence{to = To, type = T} = Packet) priority = Prio}) when is_integer(Prio) -> Pid = element(2, SID), Packet1 = Packet#presence{to = jid:replace_resource(To, R)}, - ?DEBUG("sending to process ~p:~n~s", + ?DEBUG("Sending to process ~p:~n~s", [Pid, xmpp:pp(Packet1)]), ejabberd_c2s:route(Pid, {route, Packet1}); (_) -> @@ -672,14 +672,14 @@ do_route(#presence{to = To, type = T} = Packet) ok end; do_route(#presence{to = #jid{lresource = <<"">>} = To} = Packet) -> - ?DEBUG("processing presence to bare JID:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Processing presence to bare JID:~n~s", [xmpp:pp(Packet)]), {LUser, LServer, _} = jid:tolower(To), lists:foreach( fun({_, R}) -> do_route(Packet#presence{to = jid:replace_resource(To, R)}) end, get_user_present_resources(LUser, LServer)); do_route(#message{to = #jid{lresource = <<"">>} = To, type = T} = Packet) -> - ?DEBUG("processing message to bare JID:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Processing message to bare JID:~n~s", [xmpp:pp(Packet)]), if T == chat; T == headline; T == normal -> route_message(Packet); true -> @@ -688,14 +688,14 @@ do_route(#message{to = #jid{lresource = <<"">>} = To, type = T} = Packet) -> end; do_route(#iq{to = #jid{lresource = <<"">>} = To, type = T} = Packet) -> if T == set; T == get -> - ?DEBUG("processing IQ to bare JID:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Processing IQ to bare JID:~n~s", [xmpp:pp(Packet)]), gen_iq_handler:handle(?MODULE, Packet); true -> ejabberd_hooks:run_fold(bounce_sm_packet, To#jid.lserver, {pass, Packet}, []) end; do_route(Packet) -> - ?DEBUG("processing packet to full JID:~n~s", [xmpp:pp(Packet)]), + ?DEBUG("Processing packet to full JID:~n~s", [xmpp:pp(Packet)]), To = xmpp:get_to(Packet), {LUser, LServer, LResource} = jid:tolower(To), Mod = get_sm_backend(LServer), @@ -717,7 +717,7 @@ do_route(Packet) -> Ss -> Session = lists:max(Ss), Pid = element(2, Session#session.sid), - ?DEBUG("sending to process ~p:~n~s", [Pid, xmpp:pp(Packet)]), + ?DEBUG("Sending to process ~p:~n~s", [Pid, xmpp:pp(Packet)]), ejabberd_c2s:route(Pid, {route, Packet}) end. @@ -752,7 +752,7 @@ route_message(#message{to = To, type = Type} = Packet) -> Ss -> Session = lists:max(Ss), Pid = element(2, Session#session.sid), - ?DEBUG("sending to process ~p~n", [Pid]), + ?DEBUG("Sending to process ~p~n", [Pid]), LMaxRes = jid:resourceprep(MaxRes), Packet1 = maybe_mark_as_copy(Packet, LResource, diff --git a/src/ejabberd_sm_redis.erl b/src/ejabberd_sm_redis.erl index e4bab3902..67e7701c6 100644 --- a/src/ejabberd_sm_redis.erl +++ b/src/ejabberd_sm_redis.erl @@ -160,11 +160,11 @@ handle_info({redis_message, ?SM_KEY, Data}, State) -> {delete, Key} -> ets_cache:delete(?SM_CACHE, Key); Msg -> - ?WARNING_MSG("unexpected redis message: ~p", [Msg]) + ?WARNING_MSG("Unexpected redis message: ~p", [Msg]) end, {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/ejabberd_sm_sql.erl b/src/ejabberd_sm_sql.erl index 71defb06c..2a048f006 100644 --- a/src/ejabberd_sm_sql.erl +++ b/src/ejabberd_sm_sql.erl @@ -53,7 +53,7 @@ init() -> {updated, _} -> ok; Err -> - ?ERROR_MSG("failed to clean 'sm' table: ~p", [Err]), + ?ERROR_MSG("Failed to clean 'sm' table: ~p", [Err]), {error, db_failure} end; (_, Err) -> diff --git a/src/ejabberd_sql.erl b/src/ejabberd_sql.erl index c7c2d2d4d..6ebf023e7 100644 --- a/src/ejabberd_sql.erl +++ b/src/ejabberd_sql.erl @@ -169,7 +169,7 @@ keep_alive(Host, PID) -> {selected,_,[[<<"1">>]]} -> ok; _Err -> - ?ERROR_MSG("keep alive query failed, closing connection: ~p", [_Err]), + ?ERROR_MSG("Keep alive query failed, closing connection: ~p", [_Err]), sync_send_event(PID, force_timeout, query_timeout(Host)) end. @@ -364,7 +364,7 @@ connecting(connect, #state{host = Host} = State) -> {next_state, connecting, State} end; connecting(Event, State) -> - ?WARNING_MSG("unexpected event in 'connecting': ~p", + ?WARNING_MSG("Unexpected event in 'connecting': ~p", [Event]), {next_state, connecting, State}. @@ -376,7 +376,7 @@ connecting({sql_cmd, {sql_query, ?KEEPALIVE_QUERY}, {next_state, connecting, State}; connecting({sql_cmd, Command, Timestamp} = Req, From, State) -> - ?DEBUG("queuing pending request while connecting:~n\t~p", + ?DEBUG("Queuing pending request while connecting:~n\t~p", [Req]), PendingRequests = try p1_queue:in({sql_cmd, Command, From, Timestamp}, @@ -393,7 +393,7 @@ connecting({sql_cmd, Command, Timestamp} = Req, From, {next_state, connecting, State#state{pending_requests = PendingRequests}}; connecting(Request, {Who, _Ref}, State) -> - ?WARNING_MSG("unexpected call ~p from ~p in 'connecting'", + ?WARNING_MSG("Unexpected call ~p from ~p in 'connecting'", [Request, Who]), {reply, {error, badarg}, connecting, State}. @@ -401,7 +401,7 @@ session_established({sql_cmd, Command, Timestamp}, From, State) -> run_sql_cmd(Command, From, State, Timestamp); session_established(Request, {Who, _Ref}, State) -> - ?WARNING_MSG("unexpected call ~p from ~p in 'session_establ" + ?WARNING_MSG("Unexpected call ~p from ~p in 'session_establ" "ished'", [Request, Who]), {reply, {error, badarg}, session_established, State}. @@ -412,7 +412,7 @@ session_established({sql_cmd, Command, From, Timestamp}, session_established(force_timeout, State) -> {stop, timeout, State}; session_established(Event, State) -> - ?WARNING_MSG("unexpected event in 'session_established': ~p", + ?WARNING_MSG("Unexpected event in 'session_established': ~p", [Event]), {next_state, session_established, State}. @@ -432,7 +432,7 @@ handle_info({'DOWN', _MonitorRef, process, _Pid, _Info}, p1_fsm:send_event(self(), connect), {next_state, connecting, State}; handle_info(Info, StateName, State) -> - ?WARNING_MSG("unexpected info in ~p: ~p", + ?WARNING_MSG("Unexpected info in ~p: ~p", [StateName, Info]), {next_state, StateName, State}. @@ -496,7 +496,7 @@ inner_transaction(F) -> case get(?NESTING_KEY) of ?TOP_LEVEL_TXN -> {backtrace, T} = process_info(self(), backtrace), - ?ERROR_MSG("inner transaction called at outer txn " + ?ERROR_MSG("Inner transaction called at outer txn " "level. Trace: ~s", [T]), erlang:exit(implementation_faulty); @@ -518,7 +518,7 @@ outer_transaction(F, NRestarts, _Reason) -> ?TOP_LEVEL_TXN -> ok; _N -> {backtrace, T} = process_info(self(), backtrace), - ?ERROR_MSG("outer transaction called at inner txn " + ?ERROR_MSG("Outer transaction called at inner txn " "level. Trace: ~s", [T]), erlang:exit(implementation_faulty) @@ -965,11 +965,11 @@ get_db_version(#state{db_type = pgsql} = State) -> Version when is_integer(Version) -> State#state{db_version = Version}; Error -> - ?WARNING_MSG("error getting pgsql version: ~p", [Error]), + ?WARNING_MSG("Error getting pgsql version: ~p", [Error]), State end; Res -> - ?WARNING_MSG("error getting pgsql version: ~p", [Res]), + ?WARNING_MSG("Error getting pgsql version: ~p", [Res]), State end; get_db_version(State) -> @@ -1092,12 +1092,12 @@ init_mssql(Host) -> os:putenv("FREETDSCONF", freetds_config()), ok catch error:{badmatch, {error, Reason} = Err} -> - ?ERROR_MSG("failed to create temporary files in ~s: ~s", + ?ERROR_MSG("Failed to create temporary files in ~s: ~s", [tmp_dir(), file:format_error(Reason)]), Err end; {error, Reason} = Err -> - ?ERROR_MSG("failed to create temporary directory ~s: ~s", + ?ERROR_MSG("Failed to create temporary directory ~s: ~s", [tmp_dir(), file:format_error(Reason)]), Err end. diff --git a/src/ejabberd_sql_sup.erl b/src/ejabberd_sql_sup.erl index b5553ec40..fc16b784b 100644 --- a/src/ejabberd_sql_sup.erl +++ b/src/ejabberd_sql_sup.erl @@ -118,7 +118,7 @@ remove_pid(Host, Pid) -> get_pool_size(SQLType, Host) -> PoolSize = ejabberd_option:sql_pool_size(Host), if PoolSize > 1 andalso SQLType == sqlite -> - ?WARNING_MSG("it's not recommended to set sql_pool_size > 1 for " + ?WARNING_MSG("It's not recommended to set sql_pool_size > 1 for " "sqlite, because it may cause race conditions", []); true -> ok diff --git a/src/ejabberd_update.erl b/src/ejabberd_update.erl index c7aa652c1..fad9ce5b8 100644 --- a/src/ejabberd_update.erl +++ b/src/ejabberd_update.erl @@ -43,7 +43,7 @@ update() -> eval_script( LowLevelScript, [], [{ejabberd, "", filename:join(Dir, "..")}]), - ?DEBUG("eval: ~p~n", [Eval]), + ?DEBUG("Eval: ~p~n", [Eval]), Eval; {error, Reason} -> {error, Reason} @@ -60,7 +60,7 @@ update(ModulesToUpdate) -> eval_script( LowLevelScript, [], [{ejabberd, "", filename:join(Dir, "..")}]), - ?DEBUG("eval: ~p~n", [Eval]), + ?DEBUG("Eval: ~p~n", [Eval]), Eval; {error, Reason} -> {error, Reason} @@ -86,7 +86,7 @@ update_info() -> update_info(Dir, Files) -> Beams = lists:sort(get_beams(Files)), UpdatedBeams = get_updated_beams(Beams), - ?DEBUG("beam files: ~p~n", [UpdatedBeams]), + ?DEBUG("BEAM files: ~p~n", [UpdatedBeams]), {Script, LowLevelScript, Check} = build_script(Dir, UpdatedBeams), {ok, Dir, UpdatedBeams, Script, LowLevelScript, Check}. @@ -135,46 +135,46 @@ build_script(Dir, UpdatedBeams) -> [{ejabberd, "", filename:join(Dir, "..")}]), Check1 = case Check of {ok, []} -> - ?DEBUG("script: ~p~n", [Script]), - ?DEBUG("low level script: ~p~n", [LowLevelScript]), - ?DEBUG("check: ~p~n", [Check]), + ?DEBUG("Script: ~p~n", [Script]), + ?DEBUG("Low level script: ~p~n", [LowLevelScript]), + ?DEBUG("Check: ~p~n", [Check]), ok; _ -> - ?ERROR_MSG("script: ~p~n", [Script]), - ?ERROR_MSG("low level script: ~p~n", [LowLevelScript]), - ?ERROR_MSG("check: ~p~n", [Check]), + ?ERROR_MSG("Script: ~p~n", [Script]), + ?ERROR_MSG("Low level script: ~p~n", [LowLevelScript]), + ?ERROR_MSG("Check: ~p~n", [Check]), error end, {Script, LowLevelScript, Check1}. %% Copied from Erlang/OTP file: lib/sasl/src/systools.hrl --record(application, +-record(application, {name, %% Name of the application, atom(). type = permanent, %% Application start type, atom(). vsn = "", %% Version of the application, string(). id = "", %% Id of the application, string(). description = "", %% Description of application, string(). - modules = [], %% [Module | {Module,Vsn}] of modules - %% incorporated in the application, + modules = [], %% [Module | {Module,Vsn}] of modules + %% incorporated in the application, %% Module = atom(), Vsn = string(). uses = [], %% [Application] list of applications required %% by the application, Application = atom(). includes = [], %% [Application] list of applications included %% by the application, Application = atom(). - regs = [], %% [RegNames] a list of registered process + regs = [], %% [RegNames] a list of registered process %% names used by the application, RegNames = %% atom(). - env = [], %% [{Key,Value}] environment variable of + env = [], %% [{Key,Value}] environment variable of %% application, Key = Value = term(). - maxT = infinity, %% Max time an application may exist, + maxT = infinity, %% Max time an application may exist, %% integer() | infinity. maxP = infinity, %% Max number of processes in an application, %% integer() | infinity. - mod = [], %% [] | {Mod, StartArgs}, Mod= atom(), + mod = [], %% [] | {Mod, StartArgs}, Mod= atom(), %% StartArgs = list(). start_phases = [], %% [] | {Phase, PhaseArgs}, Phase = atom(), %% PhaseArgs = list(). - dir = "" %% The directory where the .app file was + dir = "" %% The directory where the .app file was %% found (internal use). }). diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index c50d51bb9..89a900a2f 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -463,7 +463,7 @@ process_admin(Host, #request{path = [<<"online-users">>], process_admin(Host, #request{path = [<<"last-activity">>], q = Query, lang = Lang}, AJID) when is_binary(Host) -> - ?DEBUG("query: ~p", [Query]), + ?DEBUG("Query: ~p", [Query]), Month = case lists:keysearch(<<"period">>, 1, Query) of {value, {_, Val}} -> Val; _ -> <<"month">> diff --git a/src/ejabberd_websocket.erl b/src/ejabberd_websocket.erl index 1767a1603..82443eec5 100644 --- a/src/ejabberd_websocket.erl +++ b/src/ejabberd_websocket.erl @@ -192,7 +192,7 @@ ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode) -> {DataType, _Socket, Data} when DataType =:= tcp orelse DataType =:= raw -> case handle_data(DataType, FrameInfo, Data, Socket, WsHandleLoopPid, SocketMode) of {error, Error} -> - ?DEBUG("tls decode error ~p", [Error]), + ?DEBUG("TLS decode error ~p", [Error]), websocket_close(Socket, WsHandleLoopPid, SocketMode, 1002); % protocol error {NewFrameInfo, ToSend} -> lists:foreach(fun(Pkt) -> SocketMode:send(Socket, Pkt) @@ -200,17 +200,17 @@ ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode) -> ws_loop(NewFrameInfo, Socket, WsHandleLoopPid, SocketMode) end; {tcp_closed, _Socket} -> - ?DEBUG("tcp connection was closed, exit", []), + ?DEBUG("TCP connection was closed, exit", []), websocket_close(Socket, WsHandleLoopPid, SocketMode, 0); {tcp_error, Socket, Reason} -> - ?DEBUG("tcp connection error: ~s", [inet:format_error(Reason)]), + ?DEBUG("TCP connection error: ~s", [inet:format_error(Reason)]), websocket_close(Socket, WsHandleLoopPid, SocketMode, 0); {'DOWN', Ref, process, WsHandleLoopPid, Reason} -> Code = case Reason of normal -> 1000; % normal close _ -> - ?ERROR_MSG("linked websocket controlling loop crashed " + ?ERROR_MSG("Linked websocket controlling loop crashed " "with reason: ~p", [Reason]), 1011 % internal error @@ -230,12 +230,12 @@ ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode) -> ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode); shutdown -> - ?DEBUG("shutdown request received, closing websocket " + ?DEBUG("Shutdown request received, closing websocket " "with pid ~p", [self()]), websocket_close(Socket, WsHandleLoopPid, SocketMode, 1001); % going away _Ignored -> - ?WARNING_MSG("received unexpected message, ignoring: ~p", + ?WARNING_MSG("Received unexpected message, ignoring: ~p", [_Ignored]), ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode) diff --git a/src/ejabberd_xmlrpc.erl b/src/ejabberd_xmlrpc.erl index 5b26d07b0..1a8128ae9 100644 --- a/src/ejabberd_xmlrpc.erl +++ b/src/ejabberd_xmlrpc.erl @@ -220,7 +220,7 @@ process(_, #request{method = 'POST', data = Data, opts = Opts, ip = {IP, _}}) -> #xmlel{name = <<"h1">>, attrs = [], children = [{xmlcdata, <<"Malformed Request">>}]}}; {ok, RPC} -> - ?DEBUG("got XML-RPC request: ~p", [RPC]), + ?DEBUG("Got XML-RPC request: ~p", [RPC]), {false, Result} = handler(State, RPC), XML = fxml:element_to_binary(fxmlrpc:encode(Result)), {200, [{<<"Content-Type">>, <<"text/xml">>}], @@ -486,7 +486,7 @@ format_arg(Arg, string) when is_binary(Arg) -> binary_to_list(Arg); format_arg(undefined, binary) -> <<>>; format_arg(undefined, string) -> ""; format_arg(Arg, Format) -> - ?ERROR_MSG("don't know how to format Arg ~p for format ~p", [Arg, Format]), + ?ERROR_MSG("Don't know how to format Arg ~p for format ~p", [Arg, Format]), exit({invalid_arg_type, Arg, Format}). process_unicode_codepoints(Str) -> diff --git a/src/ejd2sql.erl b/src/ejd2sql.erl index 546b86879..42c4e83f5 100644 --- a/src/ejd2sql.erl +++ b/src/ejd2sql.erl @@ -114,7 +114,7 @@ delete(Server, Module) -> import(Server, Dir, ToType) -> lists:foreach( fun(Mod) -> - ?INFO_MSG("importing ~p...", [Mod]), + ?INFO_MSG("Importing ~p...", [Mod]), import(Mod, Server, Dir, ToType) end, modules()). diff --git a/src/eldap.erl b/src/eldap.erl index 760f2557b..fb55837e5 100644 --- a/src/eldap.erl +++ b/src/eldap.erl @@ -6,7 +6,7 @@ %%% draft-ietf-asid-ldap-c-api-00.txt %%% %%% Copyright (C) 2000 Torbjorn Tornkvist, tnt@home.se -%%% +%%% %%% %%% This program is free software; you can redistribute it and/or modify %%% it under the terms of the GNU General Public License as published by @@ -181,7 +181,7 @@ close(Handle) -> %%% to succeed. The parent of the entry MUST exist. %%% Example: %%% -%%% add(Handle, +%%% add(Handle, %%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com", %%% [{"objectclass", ["person"]}, %%% {"cn", ["Bill Valentine"]}, @@ -205,11 +205,11 @@ add_attrs(Attrs) -> end. %%% -------------------------------------------------------------------- -%%% Delete an entry. The entry consists of the DN of +%%% Delete an entry. The entry consists of the DN of %%% the entry to be deleted. %%% Example: %%% -%%% delete(Handle, +%%% delete(Handle, %%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com" %%% ) %%% -------------------------------------------------------------------- @@ -223,10 +223,10 @@ delete(Handle, Entry) -> %%% operations can be performed as one atomic operation. %%% Example: %%% -%%% modify(Handle, +%%% modify(Handle, %%% "cn=Torbjorn Tornkvist, ou=people, o=Bluetail AB, dc=bluetail, dc=com", %%% [replace("telephoneNumber", ["555 555 00"]), -%%% add("description", ["LDAP hacker"])] +%%% add("description", ["LDAP hacker"])] %%% ) %%% -------------------------------------------------------------------- -spec modify(handle(), any(), [add | delete | replace]) -> any(). @@ -237,7 +237,7 @@ modify(Handle, Object, Mods) -> ?CALL_TIMEOUT). %%% -%%% Modification operations. +%%% Modification operations. %%% Example: %%% replace("telephoneNumber", ["555 555 00"]) %%% @@ -252,7 +252,7 @@ mod_delete(Type, Values) -> %%% operations can be performed as one atomic operation. %%% Example: %%% -%%% modify_dn(Handle, +%%% modify_dn(Handle, %%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com", %%% "cn=Ben Emerson", %%% true, @@ -289,12 +289,12 @@ modify_passwd(Handle, DN, Passwd) -> %%% Bind. %%% Example: %%% -%%% bind(Handle, +%%% bind(Handle, %%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com", %%% "secret") %%% -------------------------------------------------------------------- -spec bind(handle(), binary(), binary()) -> any(). - + bind(Handle, RootDN, Passwd) -> Handle1 = get_handle(Handle), p1_fsm:sync_send_event(Handle1, {bind, RootDN, Passwd}, @@ -308,7 +308,7 @@ optional([]) -> asn1_NOVALUE; optional(Value) -> Value. %%% -------------------------------------------------------------------- -%%% Synchronous search of the Directory returning a +%%% Synchronous search of the Directory returning a %%% requested set of attributes. %%% %%% Example: @@ -560,9 +560,9 @@ get_handle(Name) when is_binary(Name) -> %% Returns: {ok, StateName, StateData} | %% {ok, StateName, StateData, Timeout} | %% ignore | -%% {stop, StopReason} +%% {stop, StopReason} %% I use the trick of setting a timeout of 0 to pass control into the -%% process. +%% process. %%---------------------------------------------------------------------- init([Hosts, Port, Rootdn, Passwd, Opts]) -> Encrypt = case proplists:get_value(encrypt, Opts) of @@ -639,7 +639,7 @@ active(Event, From, S) -> %% Called when p1_fsm:send_all_state_event/2 is invoked. %% Returns: {next_state, NextStateName, NextStateData} | %% {next_state, NextStateName, NextStateData, Timeout} | -%% {stop, Reason, NewStateData} +%% {stop, Reason, NewStateData} %%---------------------------------------------------------------------- handle_event(close, _StateName, S) -> catch (S#eldap.sockmod):close(S#eldap.fd), @@ -655,7 +655,7 @@ handle_sync_event(_Event, _From, StateName, S) -> %% handle_info({Tag, _Socket, Data}, connecting, S) when Tag == tcp; Tag == ssl -> - ?DEBUG("tcp packet received when disconnected!~n~p", [Data]), + ?DEBUG("TCP packet received when disconnected!~n~p", [Data]), {next_state, connecting, S}; handle_info({Tag, _Socket, Data}, wait_bind_response, S) when Tag == tcp; Tag == ssl -> @@ -721,7 +721,7 @@ handle_info({timeout, _Timer, bind_timeout}, wait_bind_response, S) -> %% Make sure we don't fill the message queue with rubbish %% handle_info(Info, StateName, S) -> - ?DEBUG("eldap. Unexpected Info: ~p~nIn state: " + ?DEBUG("Unexpected Info: ~p~nIn state: " "~p~n when StateData is: ~p", [Info, StateName, S]), {next_state, StateName, S}. @@ -822,7 +822,7 @@ gen_req({bind, RootDN, Passwd}) -> %% recvd_packet %% Deals with incoming packets in the active state %% Will return one of: -%% {ok, NewS} - Don't reply to client yet as this is part of a search +%% {ok, NewS} - Don't reply to client yet as this is part of a search %% result and we haven't got all the answers yet. %% {reply, Result, From, NewS} - Reply with result to client From %% {error, Reason} diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl index c0b7a9dd4..87fb62c06 100644 --- a/src/gen_iq_handler.erl +++ b/src/gen_iq_handler.erl @@ -112,7 +112,7 @@ process_iq(_Host, Module, Function, IQ) -> ignore -> ok catch ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to process iq:~n~s~nReason = ~p", + ?ERROR_MSG("Failed to process iq:~n~s~nReason = ~p", [xmpp:pp(IQ), {E, {R, ?EX_STACK(St)}}]), Txt = ?T("Module failed to handle the query"), Err = xmpp:err_internal_server_error(Txt, IQ#iq.lang), diff --git a/src/jd2ejd.erl b/src/jd2ejd.erl index 0122a7f2d..46224dea5 100644 --- a/src/jd2ejd.erl +++ b/src/jd2ejd.erl @@ -144,7 +144,7 @@ xdb_data(User, Server, #xmlel{attrs = Attrs} = El) -> From, [{XMLNS, El#xmlel{attrs = NewAttrs}}]); _ -> - ?DEBUG("jd2ejd: Unknown namespace \"~s\"~n", [XMLNS]) + ?DEBUG("Unknown namespace \"~s\"~n", [XMLNS]) end, ok end. @@ -166,7 +166,7 @@ process_offline(Server, To, #xmlel{children = Els}) -> ok catch _:{xmpp_codec, Why} -> Txt = xmpp:format_error(Why), - ?ERROR_MSG("failed to decode XML '~s': ~s", + ?ERROR_MSG("Failed to decode XML '~s': ~s", [fxml:element_to_binary(El), Txt]) end end, Els). diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index abfc1c3b6..5de3a96c9 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -849,7 +849,7 @@ check_password_hash(User, Host, PasswordHash, HashMethod) -> {A, _} when is_tuple(A) -> scrammed; {_, true} -> get_hash(AccountPass, HashMethod); {_, false} -> - ?ERROR_MSG("check_password_hash called " + ?ERROR_MSG("Check_password_hash called " "with hash method: ~p", [HashMethod]), undefined end, diff --git a/src/mod_announce.erl b/src/mod_announce.erl index 69251e665..bdd2751b7 100644 --- a/src/mod_announce.erl +++ b/src/mod_announce.erl @@ -143,12 +143,12 @@ handle_cast({F, #message{from = From, to = To} = Pkt}, State) when is_atom(F) -> end, {noreply, State}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #state{host = Host}) -> @@ -597,7 +597,7 @@ handle_adhoc_form(From, #jid{lserver = LServer} = To, Junk -> %% This can't happen, as we haven't registered any other %% command nodes. - ?ERROR_MSG("got unexpected node/body = ~p", [Junk]), + ?ERROR_MSG("Unexpected node/body = ~p", [Junk]), {error, xmpp:err_internal_server_error()} end. @@ -722,7 +722,7 @@ send_motd({#presence{type = available}, ok end catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode motd packet ~p: ~s", + ?ERROR_MSG("Failed to decode motd packet ~p: ~s", [Packet, xmpp:format_error(Why)]) end; _ -> @@ -806,7 +806,7 @@ get_stored_motd(LServer) -> #message{body = Body, subject = Subject} -> {xmpp:get_text(Subject), xmpp:get_text(Body)} catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode motd packet ~p: ~s", + ?ERROR_MSG("Failed to decode motd packet ~p: ~s", [Packet, xmpp:format_error(Why)]) end; _ -> diff --git a/src/mod_announce_sql.erl b/src/mod_announce_sql.erl index dc05afe20..778888d14 100644 --- a/src/mod_announce_sql.erl +++ b/src/mod_announce_sql.erl @@ -154,7 +154,7 @@ parse_element(XML) -> El when is_record(El, xmlel) -> {ok, El}; _ -> - ?ERROR_MSG("malformed XML element in SQL table " + ?ERROR_MSG("Malformed XML element in SQL table " "'motd' for username='': ~s", [XML]), {error, db_failure} end. diff --git a/src/mod_avatar.erl b/src/mod_avatar.erl index 2dd0adbc2..67f0aef20 100644 --- a/src/mod_avatar.erl +++ b/src/mod_avatar.erl @@ -95,11 +95,11 @@ pubsub_publish_item(LServer, ?NS_AVATAR_METADATA, set_vcard_avatar(From, Photo, #{}) end; _ -> - ?WARNING_MSG("invalid avatar metadata of ~s@~s published " + ?WARNING_MSG("Invalid avatar metadata of ~s@~s published " "with item id ~s", [LUser, LServer, ItemId]) catch _:{xmpp_codec, Why} -> - ?WARNING_MSG("failed to decode avatar metadata of ~s@~s: ~s", + ?WARNING_MSG("Failed to decode avatar metadata of ~s@~s: ~s", [LUser, LServer, xmpp:format_error(Why)]) end; pubsub_publish_item(_, _, _, _, _, _) -> @@ -208,12 +208,12 @@ get_avatar_data(JID, ItemID) -> #avatar_data{data = Data} -> {ok, Data}; _ -> - ?WARNING_MSG("invalid avatar data detected " + ?WARNING_MSG("Invalid avatar data detected " "for ~s@~s with item id ~s", [LUser, LServer, ItemID]), {error, invalid_data} catch _:{xmpp_codec, Why} -> - ?WARNING_MSG("failed to decode avatar data for " + ?WARNING_MSG("Failed to decode avatar data for " "~s@~s with item id ~s: ~s", [LUser, LServer, ItemID, xmpp:format_error(Why)]), @@ -227,7 +227,7 @@ get_avatar_data(JID, ItemID) -> {error, #stanza_error{reason = 'item-not-found'}} -> {error, notfound}; {error, Reason} -> - ?WARNING_MSG("failed to get item for ~s@~s at node ~s " + ?WARNING_MSG("Failed to get item for ~s@~s at node ~s " "with item id ~s: ~p", [LUser, LServer, ?NS_AVATAR_METADATA, ItemID, Reason]), {error, internal_error} @@ -246,12 +246,12 @@ get_avatar_meta(#iq{from = JID}) -> #avatar_meta{} = Meta -> {ok, ItemID, Meta}; _ -> - ?WARNING_MSG("invalid metadata payload detected " + ?WARNING_MSG("Invalid metadata payload detected " "for ~s@~s with item id ~s", [LUser, LServer, ItemID]), {error, invalid_metadata} catch _:{xmpp_codec, Why} -> - ?WARNING_MSG("failed to decode metadata for " + ?WARNING_MSG("Failed to decode metadata for " "~s@~s with item id ~s: ~s", [LUser, LServer, ItemID, xmpp:format_error(Why)]), @@ -260,7 +260,7 @@ get_avatar_meta(#iq{from = JID}) -> {error, #stanza_error{reason = 'item-not-found'}} -> {error, notfound}; {error, Reason} -> - ?WARNING_MSG("failed to get items for ~s@~s at node ~s: ~p", + ?WARNING_MSG("Failed to get items for ~s@~s at node ~s: ~p", [LUser, LServer, ?NS_AVATAR_METADATA, Reason]), {error, internal_error} end. @@ -392,11 +392,11 @@ get_vcard(#jid{luser = LUser, lserver = LServer}) -> #vcard_temp{} = VCard -> {ok, VCard}; _ -> - ?ERROR_MSG("invalid vCard of ~s@~s in the database", + ?ERROR_MSG("Invalid vCard of ~s@~s in the database", [LUser, LServer]), {error, invalid_vcard} catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode vCard of ~s@~s: ~s", + ?ERROR_MSG("Failed to decode vCard of ~s@~s: ~s", [LUser, LServer, xmpp:format_error(Why)]), {error, invalid_vcard} end. diff --git a/src/mod_bosh_mnesia.erl b/src/mod_bosh_mnesia.erl index 4547d58bd..824e06b55 100644 --- a/src/mod_bosh_mnesia.erl +++ b/src/mod_bosh_mnesia.erl @@ -116,7 +116,7 @@ handle_info({delete, Session}, State) -> delete_session(Session), {noreply, State}; handle_info(_Info, State) -> - ?ERROR_MSG("got unexpected info: ~p", [_Info]), + ?ERROR_MSG("Unexpected info: ~p", [_Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/mod_bosh_redis.erl b/src/mod_bosh_redis.erl index b94322194..c1840604e 100644 --- a/src/mod_bosh_redis.erl +++ b/src/mod_bosh_redis.erl @@ -89,7 +89,7 @@ find_session(SID) -> try {ok, binary_to_term(Pid)} catch _:badarg -> - ?ERROR_MSG("malformed data in redis (key = '~s'): ~p", + ?ERROR_MSG("Malformed data in redis (key = '~s'): ~p", [SID, Pid]), {error, db_failure} end; @@ -118,7 +118,7 @@ handle_info({redis_message, ?BOSH_KEY, SID}, State) -> ets_cache:delete(?BOSH_CACHE, SID), {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> @@ -145,5 +145,5 @@ clean_table() -> end), ok; {error, _} -> - ?ERROR_MSG("failed to clean bosh sessions in redis", []) + ?ERROR_MSG("Failed to clean bosh sessions in redis", []) end. diff --git a/src/mod_bosh_riak.erl b/src/mod_bosh_riak.erl index 082141747..4280e83c8 100644 --- a/src/mod_bosh_riak.erl +++ b/src/mod_bosh_riak.erl @@ -66,6 +66,6 @@ clean_table() -> ok end, Rs); {error, Reason} = Err -> - ?ERROR_MSG("failed to clean Riak 'bosh' table: ~p", [Reason]), + ?ERROR_MSG("Failed to clean Riak 'bosh' table: ~p", [Reason]), Err end. diff --git a/src/mod_bosh_sql.erl b/src/mod_bosh_sql.erl index 328211b83..102372a69 100644 --- a/src/mod_bosh_sql.erl +++ b/src/mod_bosh_sql.erl @@ -44,7 +44,7 @@ init() -> {updated, _} -> ok; Err -> - ?ERROR_MSG("failed to clean 'route' table: ~p", [Err]), + ?ERROR_MSG("Failed to clean 'route' table: ~p", [Err]), Err end. diff --git a/src/mod_caps.erl b/src/mod_caps.erl index 21f18f10c..f1fc0e8f6 100644 --- a/src/mod_caps.erl +++ b/src/mod_caps.erl @@ -295,7 +295,7 @@ handle_info({iq_reply, IQReply, {Host, From, To, Caps, SubNodes}}, State) -> feature_response(IQReply, Host, From, To, Caps, SubNodes), {noreply, State}; handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, State) -> diff --git a/src/mod_delegation.erl b/src/mod_delegation.erl index 0009cd619..e83d94d44 100644 --- a/src/mod_delegation.erl +++ b/src/mod_delegation.erl @@ -205,7 +205,7 @@ handle_info({iq_reply, ResIQ, #iq{} = IQ}, State) -> process_iq_result(IQ, ResIQ), {noreply, State}; handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, State) -> @@ -277,7 +277,7 @@ process_iq_result(#iq{from = From, to = To, id = ID, lang = Lang} = IQ, ejabberd_router:route(Reply) end catch _:_ -> - ?ERROR_MSG("got iq-result with invalid delegated " + ?ERROR_MSG("Got iq-result with invalid delegated " "payload:~n~s", [xmpp:pp(ResIQ)]), Txt = ?T("External component failure"), Err = xmpp:err_internal_server_error(Txt, Lang), diff --git a/src/mod_fail2ban.erl b/src/mod_fail2ban.erl index 025d46244..eeb9186a6 100644 --- a/src/mod_fail2ban.erl +++ b/src/mod_fail2ban.erl @@ -140,11 +140,11 @@ handle_call(_Request, _From, State) -> {reply, Reply, State}. handle_cast(_Msg, State) -> - ?ERROR_MSG("got unexpected cast = ~p", [_Msg]), + ?ERROR_MSG("Unexpected cast = ~p", [_Msg]), {noreply, State}. handle_info(clean, State) -> - ?DEBUG("cleaning ~p ETS table", [failed_auth]), + ?DEBUG("Cleaning ~p ETS table", [failed_auth]), Now = erlang:system_time(second), ets:select_delete( failed_auth, @@ -152,7 +152,7 @@ handle_info(clean, State) -> erlang:send_after(?CLEAN_INTERVAL, self(), clean), {noreply, State}; handle_info(_Info, State) -> - ?ERROR_MSG("got unexpected info = ~p", [_Info]), + ?ERROR_MSG("Unexpected info = ~p", [_Info]), {noreply, State}. terminate(_Reason, #state{host = Host}) -> diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 28228f3e5..4dd48158a 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -400,7 +400,7 @@ format_arg({Elements}, _ when TElDef == binary; TElDef == string -> <<"">>; _ -> - ?ERROR_MSG("missing field ~p in tuple ~p", [TElName, Elements]), + ?ERROR_MSG("Missing field ~p in tuple ~p", [TElName, Elements]), throw({invalid_parameter, io_lib:format("Missing field ~w in tuple ~w", [TElName, Elements])}) end @@ -418,7 +418,7 @@ format_arg(Arg, string) when is_binary(Arg) -> binary_to_list(Arg); format_arg(undefined, binary) -> <<>>; format_arg(undefined, string) -> ""; format_arg(Arg, Format) -> - ?ERROR_MSG("don't know how to format Arg ~p for format ~p", [Arg, Format]), + ?ERROR_MSG("Don't know how to format Arg ~p for format ~p", [Arg, Format]), throw({invalid_parameter, io_lib:format("Arg ~w is not in format ~w", [Arg, Format])}). diff --git a/src/mod_http_fileserver.erl b/src/mod_http_fileserver.erl index fbbd1eebe..01af8a2a5 100644 --- a/src/mod_http_fileserver.erl +++ b/src/mod_http_fileserver.erl @@ -136,7 +136,7 @@ initialize(Host, Opts) -> ContentTypes = build_list_content_types( mod_http_fileserver_opt:content_types(Opts), ?DEFAULT_CONTENT_TYPES), - ?DEBUG("known content types: ~s", + ?DEBUG("Known content types: ~s", [str:join([[$*, K, " -> ", V] || {K, V} <- ContentTypes], <<", ">>)]), #state{host = Host, @@ -222,7 +222,7 @@ handle_cast({reload, Host, NewOpts, _OldOpts}, OldState) -> {noreply, OldState} end; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. %%-------------------------------------------------------------------- diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl index 2da64bc84..beb164547 100644 --- a/src/mod_http_upload.erl +++ b/src/mod_http_upload.erl @@ -300,12 +300,12 @@ handle_call(get_conf, _From, custom_headers = CustomHeaders} = State) -> {reply, {ok, DocRoot, CustomHeaders}, State}; handle_call(Request, From, State) -> - ?ERROR_MSG("Got unexpected request from ~p: ~p", [From, Request]), + ?ERROR_MSG("Unexpected request from ~p: ~p", [From, Request]), {noreply, State}. -spec handle_cast(_, state()) -> {noreply, state()}. handle_cast(Request, State) -> - ?ERROR_MSG("Got unexpected request: ~p", [Request]), + ?ERROR_MSG("Unexpected request: ~p", [Request]), {noreply, State}. -spec handle_info(timeout | _, state()) -> {noreply, state()}. @@ -336,7 +336,7 @@ handle_info({timeout, _TRef, Slot}, State) -> NewState = del_slot(Slot, State), {noreply, NewState}; handle_info(Info, State) -> - ?ERROR_MSG("Got unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. -spec terminate(normal | shutdown | {shutdown, _} | _, state()) -> ok. @@ -640,7 +640,7 @@ create_slot(#state{service_url = ServiceURL}, [jid:encode(JID), ServiceURL]), {error, xmpp:err_not_acceptable()}; {ok, {Code, _Body}} -> - ?ERROR_MSG("Got unexpected status code for ~s from <~s>: ~B", + ?ERROR_MSG("Unexpected status code for ~s from <~s>: ~B", [jid:encode(JID), ServiceURL, Code]), {error, xmpp:err_service_unavailable()}; {error, Reason} -> diff --git a/src/mod_http_upload_quota.erl b/src/mod_http_upload_quota.erl index 4f0d49c0b..56d46b02e 100644 --- a/src/mod_http_upload_quota.erl +++ b/src/mod_http_upload_quota.erl @@ -124,7 +124,7 @@ init([ServerHost, Opts]) -> -spec handle_call(_, {pid(), _}, state()) -> {noreply, state()}. handle_call(Request, From, State) -> - ?ERROR_MSG("Got unexpected request from ~p: ~p", [From, Request]), + ?ERROR_MSG("Unexpected request from ~p: ~p", [From, Request]), {noreply, State}. -spec handle_cast(_, state()) -> {noreply, state()}. @@ -181,7 +181,7 @@ handle_cast({handle_slot_request, #jid{user = U, server = S} = JID, Path, Size}, end, {noreply, State#state{disk_usage = NewDiskUsage}}; handle_cast(Request, State) -> - ?ERROR_MSG("Got unexpected request: ~p", [Request]), + ?ERROR_MSG("Unexpected request: ~p", [Request]), {noreply, State}. -spec handle_info(_, state()) -> {noreply, state()}. @@ -207,7 +207,7 @@ handle_info(sweep, #state{server_host = ServerHost, end, {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("Got unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. -spec terminate(normal | shutdown | {shutdown, _} | _, state()) -> ok. diff --git a/src/mod_metrics.erl b/src/mod_metrics.erl index 8c33aa89c..9d0460070 100644 --- a/src/mod_metrics.erl +++ b/src/mod_metrics.erl @@ -173,7 +173,7 @@ get_socket(N) -> get_socket(N-1) end; {error, Reason} = Err -> - ?ERROR_MSG("can not open udp socket to grapherl: ~s", + ?ERROR_MSG("Can not open udp socket to grapherl: ~s", [inet:format_error(Reason)]), Err end; diff --git a/src/mod_mqtt_session.erl b/src/mod_mqtt_session.erl index db9a632ca..f886bc3f9 100644 --- a/src/mod_mqtt_session.erl +++ b/src/mod_mqtt_session.erl @@ -186,7 +186,7 @@ handle_call({get_state, Pid}, From, State) -> noreply(State3) end; handle_call(Request, From, State) -> - ?WARNING_MSG("Got unexpected call from ~p: ~p", [From, Request]), + ?WARNING_MSG("Unexpected call from ~p: ~p", [From, Request]), noreply(State). handle_cast(accept, #state{socket = {_, Sock}} = State) -> @@ -204,7 +204,7 @@ handle_cast(accept, #state{socket = {_, Sock}} = State) -> stop(State, {socket, Why}) end; handle_cast(Msg, State) -> - ?WARNING_MSG("Got unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), noreply(State). handle_info(Msg, #state{stop_reason = {resumed, Pid} = Reason} = State) -> @@ -275,7 +275,7 @@ handle_info({Ref, badarg}, State) when is_reference(Ref) -> %% TODO: figure out from where this messages comes from noreply(State); handle_info(Info, State) -> - ?WARNING_MSG("Got unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), noreply(State). -spec handle_packet(mqtt_packet(), state()) -> {ok, state()} | @@ -308,7 +308,7 @@ handle_packet(#pubrec{id = ID, code = Code}, State) -> {ok, State}; false -> Code1 = 'packet-identifier-not-found', - ?DEBUG("Got unexpected PUBREC with id=~B, " + ?DEBUG("Unexpected PUBREC with id=~B, " "sending PUBREL with error code '~s'", [ID, Code1]), send(State, #pubrel{id = ID, code = Code1}) end; @@ -324,7 +324,7 @@ handle_packet(#pubrel{id = ID}, State) -> send(State#state{acks = Acks}, #pubcomp{id = ID}); error -> Code = 'packet-identifier-not-found', - ?DEBUG("Got unexpected PUBREL with id=~B, " + ?DEBUG("Unexpected PUBREL with id=~B, " "sending PUBCOMP with error code '~s'", [ID, Code]), Pubcomp = #pubcomp{id = ID, code = Code}, send(State, Pubcomp) diff --git a/src/mod_mqtt_ws.erl b/src/mod_mqtt_ws.erl index 820b09d62..421fdde17 100644 --- a/src/mod_mqtt_ws.erl +++ b/src/mod_mqtt_ws.erl @@ -101,13 +101,13 @@ handle_call({send, Data}, _From, #state{ws_pid = WsPid} = State) -> WsPid ! {data, Data}, {reply, ok, State}; handle_call(Request, From, State) -> - ?WARNING_MSG("Got unexpected call from ~p: ~p", [From, Request]), + ?WARNING_MSG("Unexpected call from ~p: ~p", [From, Request]), {noreply, State}. handle_cast(close, State) -> {stop, normal, State#state{mqtt_session = undefined}}; handle_cast(Request, State) -> - ?WARNING_MSG("Got unexpected cast: ~p", [Request]), + ?WARNING_MSG("Unexpected cast: ~p", [Request]), {noreply, State}. handle_info(closed, State) -> @@ -119,7 +119,7 @@ handle_info({'DOWN', _, process, Pid, _}, State) when Pid == State#state.mqtt_session orelse Pid == State#state.ws_pid -> {stop, normal, State}; handle_info(Info, State) -> - ?WARNING_MSG("Got unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, State) -> diff --git a/src/mod_muc.erl b/src/mod_muc.erl index 382348916..ef9a904b8 100644 --- a/src/mod_muc.erl +++ b/src/mod_muc.erl @@ -310,7 +310,7 @@ handle_cast({reload, ServerHost, NewOpts, OldOpts}, #state{hosts = OldHosts}) -> end, misc:intersection(NewHosts, OldHosts)), {noreply, NewState}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({route, Packet}, @@ -337,7 +337,7 @@ handle_info({room_destroyed, {Room, Host}, Pid}, State) -> RMod:unregister_online_room(ServerHost, Room, Host, Pid), {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #state{hosts = MyHosts}) -> diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl index 4b9a6154d..2ad8475fc 100644 --- a/src/mod_muc_log.erl +++ b/src/mod_muc_log.erl @@ -115,7 +115,7 @@ handle_cast({add_to_log, Type, Data, Room, Opts}, State) -> end, {noreply, State}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(_Info, State) -> {noreply, State}. diff --git a/src/mod_muc_mnesia.erl b/src/mod_muc_mnesia.erl index 1bc81e97d..0b1321f62 100644 --- a/src/mod_muc_mnesia.erl +++ b/src/mod_muc_mnesia.erl @@ -342,7 +342,7 @@ handle_info({mnesia_system_event, {mnesia_down, Node}}, State) -> handle_info({mnesia_system_event, {mnesia_up, _Node}}, State) -> {noreply, State}; handle_info(Info, State) -> - ?ERROR_MSG("unexpected info: ~p", [Info]), + ?ERROR_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 27d9ef2d6..9332b698c 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -2783,7 +2783,7 @@ process_item_change(Item, SD, UJID) -> undefined -> <<"">> end, - ?ERROR_MSG("failed to set item ~p~s: ~p", + ?ERROR_MSG("Failed to set item ~p~s: ~p", [Item, FromSuffix, {E, {R, ?EX_STACK(St)}}]), {error, xmpp:err_internal_server_error()} end. diff --git a/src/mod_muc_sql.erl b/src/mod_muc_sql.erl index 54e0315df..256c25e29 100644 --- a/src/mod_muc_sql.erl +++ b/src/mod_muc_sql.erl @@ -431,7 +431,7 @@ clean_tables(ServerHost) -> {updated, _} -> ok; Err1 -> - ?ERROR_MSG("failed to clean 'muc_online_room' table: ~p", [Err1]), + ?ERROR_MSG("Failed to clean 'muc_online_room' table: ~p", [Err1]), Err1 end, ?DEBUG("Cleaning SQL muc_online_users table...", []), @@ -441,6 +441,6 @@ clean_tables(ServerHost) -> {updated, _} -> ok; Err2 -> - ?ERROR_MSG("failed to clean 'muc_online_users' table: ~p", [Err2]), + ?ERROR_MSG("Failed to clean 'muc_online_users' table: ~p", [Err2]), Err2 end. diff --git a/src/mod_multicast.erl b/src/mod_multicast.erl index 70d1e2073..ad2256af0 100644 --- a/src/mod_multicast.erl +++ b/src/mod_multicast.erl @@ -183,7 +183,7 @@ handle_cast({reload, NewOpts, NewOpts}, {noreply, State#state{lservice = NewLServiceS, access = Access, service_limits = SLimits}}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. %%-------------------------------------------------------------------- diff --git a/src/mod_offline.erl b/src/mod_offline.erl index 8ec3183c8..01c4e04bc 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -698,7 +698,7 @@ offline_msg_to_route(LServer, #offline_msg{from = From, to = To} = R) -> Pkt2 = add_delay_info(Pkt1, LServer, R#offline_msg.timestamp), {route, Pkt2} catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode packet ~p of user ~s: ~s", + ?ERROR_MSG("Failed to decode packet ~p of user ~s: ~s", [R#offline_msg.packet, jid:encode(To), xmpp:format_error(Why)]), error @@ -728,7 +728,7 @@ read_db_messages(LUser, LServer) -> Pkt2 = xmpp:set_from_to(Pkt1, From, To), [{Node, Pkt2}] catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode packet ~p " + ?ERROR_MSG("Failed to decode packet ~p " "of user ~s: ~s", [El, jid:encode(To), xmpp:format_error(Why)]), diff --git a/src/mod_offline_sql.erl b/src/mod_offline_sql.erl index fe2ae42a4..822ca7f43 100644 --- a/src/mod_offline_sql.erl +++ b/src/mod_offline_sql.erl @@ -216,7 +216,7 @@ export(_Server) -> "server_host=%(LServer)s", "xml=%(XML)s"])] catch _:{xmpp_codec, Why} -> - ?ERROR_MSG("failed to decode packet ~p of user ~s@~s: ~s", + ?ERROR_MSG("Failed to decode packet ~p of user ~s@~s: ~s", [El, LUser, LServer, xmpp:format_error(Why)]), [] end; @@ -235,7 +235,7 @@ xml_to_offline_msg(XML) -> #xmlel{} = El -> el_to_offline_msg(El); Err -> - ?ERROR_MSG("got ~p when parsing XML packet ~s", + ?ERROR_MSG("Got ~p when parsing XML packet ~s", [Err, XML]), Err end. @@ -251,10 +251,10 @@ el_to_offline_msg(El) -> to = To, packet = El}} catch _:{bad_jid, To_s} -> - ?ERROR_MSG("failed to get 'to' JID from offline XML ~p", [El]), + ?ERROR_MSG("Failed to get 'to' JID from offline XML ~p", [El]), {error, bad_jid_to}; _:{bad_jid, From_s} -> - ?ERROR_MSG("failed to get 'from' JID from offline XML ~p", [El]), + ?ERROR_MSG("Failed to get 'from' JID from offline XML ~p", [El]), {error, bad_jid_from} end. diff --git a/src/mod_ping.erl b/src/mod_ping.erl index a41bd8d1e..9c4940c6e 100644 --- a/src/mod_ping.erl +++ b/src/mod_ping.erl @@ -125,7 +125,7 @@ handle_cast({stop_ping, JID}, State) -> Timers = del_timer(JID, State#state.timers), {noreply, State#state{timers = Timers}}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({iq_reply, #iq{type = error}, JID}, State) -> diff --git a/src/mod_privacy_sql.erl b/src/mod_privacy_sql.erl index ea3a86919..673787328 100644 --- a/src/mod_privacy_sql.erl +++ b/src/mod_privacy_sql.erl @@ -286,7 +286,7 @@ raw_to_item({SType, SValue, SAction, Order, MatchAll, match_presence_in = MatchPresenceIn, match_presence_out = MatchPresenceOut}] catch _:_ -> - ?WARNING_MSG("failed to parse row: ~p", [Row]), + ?WARNING_MSG("Failed to parse row: ~p", [Row]), [] end. diff --git a/src/mod_private_sql.erl b/src/mod_private_sql.erl index e92c3e6ca..5752e321f 100644 --- a/src/mod_private_sql.erl +++ b/src/mod_private_sql.erl @@ -133,7 +133,7 @@ parse_element(LUser, LServer, XML) -> El when is_record(El, xmlel) -> {ok, El}; _ -> - ?ERROR_MSG("malformed XML element in SQL table " + ?ERROR_MSG("Malformed XML element in SQL table " "'private_storage' for user ~s@~s: ~s", [LUser, LServer, XML]), error diff --git a/src/mod_proxy65_redis.erl b/src/mod_proxy65_redis.erl index a3f7bb5a7..4395d9069 100644 --- a/src/mod_proxy65_redis.erl +++ b/src/mod_proxy65_redis.erl @@ -95,7 +95,7 @@ register_stream(SID, Pid) -> end), ok; _:badarg -> - ?ERROR_MSG("malformed data in redis (key = '~s'): ~p", + ?ERROR_MSG("Malformed data in redis (key = '~s'): ~p", [SIDKey, Val]), {error, db_failure} end @@ -128,7 +128,7 @@ unregister_stream(SID) -> catch _:badarg when Val == undefined -> ok; _:badarg -> - ?ERROR_MSG("malformed data in redis (key = '~s'): ~p", + ?ERROR_MSG("Malformed data in redis (key = '~s'): ~p", [SIDKey, Val]), {error, db_failure} end @@ -163,7 +163,7 @@ activate_stream(SID, IJID, MaxConnections, _Node) -> catch _:badarg when Val == undefined -> {error, notfound}; _:badarg -> - ?ERROR_MSG("malformed data in redis (key = '~s'): ~p", + ?ERROR_MSG("Malformed data in redis (key = '~s'): ~p", [SIDKey, Val]), {error, db_failure} end diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl index 7274bbdf9..a27dcc11c 100644 --- a/src/mod_proxy65_service.erl +++ b/src/mod_proxy65_service.erl @@ -105,7 +105,7 @@ handle_cast({reload, ServerHost, NewOpts, OldOpts}, State) -> end, OldHosts -- NewHosts), {noreply, State#state{myhosts = NewHosts}}; handle_cast(Msg, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Msg]), + ?WARNING_MSG("Unexpected cast: ~p", [Msg]), {noreply, State}. code_change(_OldVsn, State, _Extra) -> {ok, State}. @@ -213,7 +213,7 @@ process_bytestreams(#iq{type = set, lang = Lang, from = InitiatorJID, to = To, Txt = ?T("Bytestream already activated"), xmpp:make_error(IQ, xmpp:err_conflict(Txt, Lang)); {error, Err} -> - ?ERROR_MSG("failed to activate bytestream from ~s to ~s: ~p", + ?ERROR_MSG("Failed to activate bytestream from ~s to ~s: ~p", [Initiator, Target, Err]), Txt = ?T("Database failure"), xmpp:make_error(IQ, xmpp:err_internal_server_error(Txt, Lang)) diff --git a/src/mod_proxy65_sql.erl b/src/mod_proxy65_sql.erl index d655e2741..31c2dcc36 100644 --- a/src/mod_proxy65_sql.erl +++ b/src/mod_proxy65_sql.erl @@ -43,7 +43,7 @@ init() -> {updated, _} -> ok; Err -> - ?ERROR_MSG("failed to clean 'proxy65' table: ~p", [Err]), + ?ERROR_MSG("Failed to clean 'proxy65' table: ~p", [Err]), Err end. diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index d45f5961f..87b5a10a4 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -239,7 +239,7 @@ stop(Host) -> init([ServerHost, Opts]) -> process_flag(trap_exit, true), - ?DEBUG("pubsub init ~p ~p", [ServerHost, Opts]), + ?DEBUG("Pubsub init ~p ~p", [ServerHost, Opts]), Hosts = gen_mod:get_opt_hosts(Opts), Access = mod_pubsub_opt:access_createnode(Opts), PepOffline = mod_pubsub_opt:ignore_pep_from_offline(Opts), @@ -3559,11 +3559,11 @@ tree_call({_User, Server, _Resource}, Function, Args) -> tree_call(Server, Function, Args); tree_call(Host, Function, Args) -> Tree = tree(Host), - ?DEBUG("tree_call apply(~s, ~s, ~p) @ ~s", [Tree, Function, Args, Host]), + ?DEBUG("Tree_call apply(~s, ~s, ~p) @ ~s", [Tree, Function, Args, Host]), apply(Tree, Function, Args). tree_action(Host, Function, Args) -> - ?DEBUG("tree_action ~p ~p ~p", [Host, Function, Args]), + ?DEBUG("Tree_action ~p ~p ~p", [Host, Function, Args]), ServerHost = serverhost(Host), Fun = fun () -> tree_call(Host, Function, Args) end, case mod_pubsub_opt:db_type(ServerHost) of @@ -3574,7 +3574,7 @@ tree_action(Host, Function, Args) -> {atomic, Result} -> Result; {aborted, Reason} -> - ?ERROR_MSG("transaction return internal error: ~p~n", [{aborted, Reason}]), + ?ERROR_MSG("Transaction return internal error: ~p~n", [{aborted, Reason}]), ErrTxt = ?T("Database failure"), {error, xmpp:err_internal_server_error(ErrTxt, ejabberd_option:language())} end; @@ -3584,7 +3584,7 @@ tree_action(Host, Function, Args) -> %% @doc

node plugin call.

node_call(Host, Type, Function, Args) -> - ?DEBUG("node_call ~p ~p ~p", [Type, Function, Args]), + ?DEBUG("Node_call ~p ~p ~p", [Type, Function, Args]), Module = plugin(Host, Type), case apply(Module, Function, Args) of {result, Result} -> @@ -3603,7 +3603,7 @@ node_call(Host, Type, Function, Args) -> end. node_action(Host, Type, Function, Args) -> - ?DEBUG("node_action ~p ~p ~p ~p", [Host, Type, Function, Args]), + ?DEBUG("Node_action ~p ~p ~p ~p", [Host, Type, Function, Args]), transaction(Host, fun () -> node_call(Host, Type, Function, Args) end, @@ -3653,10 +3653,10 @@ do_transaction(ServerHost, Fun, Trans, DBType) -> {atomic, {error, Error}} -> {error, Error}; {aborted, Reason} -> - ?ERROR_MSG("transaction return internal error: ~p~n", [{aborted, Reason}]), + ?ERROR_MSG("Transaction return internal error: ~p~n", [{aborted, Reason}]), {error, xmpp:err_internal_server_error(?T("Database failure"), ejabberd_option:language())}; Other -> - ?ERROR_MSG("transaction return internal error: ~p~n", [Other]), + ?ERROR_MSG("Transaction return internal error: ~p~n", [Other]), {error, xmpp:err_internal_server_error(?T("Database failure"), ejabberd_option:language())} end. @@ -3833,7 +3833,7 @@ purge_offline(LJID) -> end end, lists:usort(lists:flatten(Affs))); {Error, _} -> - ?ERROR_MSG("can not purge offline: ~p", [Error]) + ?ERROR_MSG("Can not purge offline: ~p", [Error]) end. -spec purge_offline(host(), ljid(), #pubsub_node{}) -> ok | {error, stanza_error()}. diff --git a/src/mod_register.erl b/src/mod_register.erl index d5d8d35cb..ee5b76db3 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -464,8 +464,7 @@ check_timeout(Source) -> case mnesia:transaction(F) of {atomic, Res} -> Res; {aborted, Reason} -> - ?ERROR_MSG("mod_register: timeout check error: ~p~n", - [Reason]), + ?ERROR_MSG("timeout check error: ~p~n", [Reason]), true end; true -> true @@ -499,7 +498,7 @@ remove_timeout(Source) -> case mnesia:transaction(F) of {atomic, ok} -> ok; {aborted, Reason} -> - ?ERROR_MSG("mod_register: timeout remove error: " + ?ERROR_MSG("Mod_register: timeout remove error: " "~p~n", [Reason]), ok diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index 88132ee9c..3a08e1cb8 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -178,7 +178,7 @@ css() -> {ok, Data} -> {ok, Data}; {error, Why} -> - ?ERROR_MSG("failed to read ~s: ~s", [File, file:format_error(Why)]), + ?ERROR_MSG("Failed to read ~s: ~s", [File, file:format_error(Why)]), error end. diff --git a/src/mod_roster.erl b/src/mod_roster.erl index dd721db6c..ea56aeede 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -321,7 +321,7 @@ process_iq_get(#iq{to = To, lang = Lang, ver = Version} end) catch ?EX_RULE(E, R, St) -> - ?ERROR_MSG("failed to process roster get for ~s: ~p", + ?ERROR_MSG("Failed to process roster get for ~s: ~p", [jid:encode(To), {E, {R, ?EX_STACK(St)}}]), Txt = ?T("Roster module has failed"), xmpp:make_error(IQ, xmpp:err_internal_server_error(Txt, Lang)) @@ -446,7 +446,7 @@ process_iq_set(#iq{from = _From, to = To, ok -> xmpp:make_iq_result(IQ); E -> - ?ERROR_MSG("roster set failed:~nIQ = ~s~nError = ~p", + ?ERROR_MSG("Roster set failed:~nIQ = ~s~nError = ~p", [xmpp:pp(IQ), E]), xmpp:make_error(IQ, xmpp:err_internal_server_error()) end. diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 58d4eedc1..47dffca80 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -708,7 +708,7 @@ c2s_self_presence(Acc) -> unset_presence(LUser, LServer, Resource, Status) -> Resources = ejabberd_sm:get_user_resources(LUser, LServer), - ?DEBUG("unset_presence for ~p @ ~p / ~p -> ~p " + ?DEBUG("Unset_presence for ~p @ ~p / ~p -> ~p " "(~p resources)", [LUser, LServer, Resource, Status, length(Resources)]), case length(Resources) of diff --git a/src/mod_sip.erl b/src/mod_sip.erl index 9dc4686a9..54d8ac251 100644 --- a/src/mod_sip.erl +++ b/src/mod_sip.erl @@ -286,7 +286,7 @@ check_auth(#sip{method = Method, hdrs = Hdrs, body = Body}, AuthHdr, _SIPSock) - Password when is_binary(Password) -> esip:check_auth(Auth, Method, Body, Password); _ScramedPassword -> - ?ERROR_MSG("unable to authenticate ~s@~s against SCRAM'ed " + ?ERROR_MSG("Unable to authenticate ~s@~s against SCRAM'ed " "password", [LUser, LServer]), false end; diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index dc004a93c..26a4398ea 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -80,7 +80,7 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> [<<"*">>] when Expires == 0 -> case unregister_session(US, CallID, CSeq) of {ok, ContactsWithExpires} -> - ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", + ?INFO_MSG("Unregister SIP session for user ~s@~s from ~s", [LUser, LServer, inet_parse:ntoa(PeerIP)]), Cs = prepare_contacts_to_send(ContactsWithExpires), mod_sip:make_response( @@ -223,7 +223,7 @@ handle_info({'DOWN', MRef, process, _Pid, _Reason}, State) -> end, {noreply, State}; handle_info(_Info, State) -> - ?ERROR_MSG("got unexpected info: ~p", [_Info]), + ?ERROR_MSG("Unexpected info: ~p", [_Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/mod_stream_mgmt.erl b/src/mod_stream_mgmt.erl index fd18b9fa0..b669bd8d9 100644 --- a/src/mod_stream_mgmt.erl +++ b/src/mod_stream_mgmt.erl @@ -93,7 +93,7 @@ stop(Host) -> reload(_Host, NewOpts, _OldOpts) -> init_cache(NewOpts), - ?WARNING_MSG("module ~s is reloaded, but new configuration will take " + ?WARNING_MSG("Module ~s is reloaded, but new configuration will take " "effect for newly created client connections only", [?MODULE]). depends(_Host, _Opts) -> diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 8c337528f..0474f644c 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -117,7 +117,7 @@ init([Host, Opts]) -> process_local_iq_info), case Mod:is_search_supported(Host) of false -> - ?WARNING_MSG("vcard search functionality is " + ?WARNING_MSG("vCard search functionality is " "not implemented for ~s backend", [mod_vcard_opt:db_type(Opts)]); true -> @@ -133,7 +133,7 @@ handle_call(_Call, _From, State) -> {noreply, State}. handle_cast(Cast, State) -> - ?WARNING_MSG("unexpected cast: ~p", [Cast]), + ?WARNING_MSG("Unexpected cast: ~p", [Cast]), {noreply, State}. handle_info({route, Packet}, State) -> @@ -143,7 +143,7 @@ handle_info({route, Packet}, State) -> end, {noreply, State}; handle_info(Info, State) -> - ?WARNING_MSG("unexpected info: ~p", [Info]), + ?WARNING_MSG("Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #state{hosts = MyHosts, server_host = Host}) -> diff --git a/src/prosody2ejabberd.erl b/src/prosody2ejabberd.erl index 472f38b67..d38d03d82 100644 --- a/src/prosody2ejabberd.erl +++ b/src/prosody2ejabberd.erl @@ -55,7 +55,7 @@ from_dir(ProsodyDir) -> "privacy", "pep", "pubsub"]) end, HostDirs); {error, Why} = Err -> - ?ERROR_MSG("failed to list ~s: ~s", + ?ERROR_MSG("Failed to list ~s: ~s", [ProsodyDir, file:format_error(Why)]), Err end; @@ -97,7 +97,7 @@ convert_dir(Path, Host, Type) -> {error, enoent} -> ok; {error, Why} = Err -> - ?ERROR_MSG("failed to list ~s: ~s", + ?ERROR_MSG("Failed to list ~s: ~s", [Path, file:format_error(Why)]), Err end. @@ -119,11 +119,11 @@ eval_file(Path) -> {ok, _} = Res -> Res; {error, Why} = Err -> - ?ERROR_MSG("failed to eval ~s: ~p", [Path, Why]), + ?ERROR_MSG("Failed to eval ~s: ~p", [Path, Why]), Err end; {error, Why} = Err -> - ?ERROR_MSG("failed to read file ~s: ~s", + ?ERROR_MSG("Failed to read file ~s: ~s", [Path, file:format_error(Why)]), Err end. @@ -151,7 +151,7 @@ convert_data(Host, "accounts", User, [Data]) -> ok -> ok; Err -> - ?ERROR_MSG("failed to register user ~s@~s: ~p", + ?ERROR_MSG("Failed to register user ~s@~s: ~p", [User, Host, Err]), Err end; @@ -272,12 +272,12 @@ convert_data(HostStr, "pubsub", Node, [Data]) -> Error end; Error -> - ?ERROR_MSG("failed to import pubsub node ~s on ~p:~n~p", + ?ERROR_MSG("Failed to import pubsub node ~s on ~p:~n~p", [Node, Host, NodeData]), Error end; Error -> - ?ERROR_MSG("failed to import pubsub node: ~p", [Error]), + ?ERROR_MSG("Failed to import pubsub node: ~p", [Error]), Error end; convert_data(_Host, _Type, _User, _Data) ->