aboutsummaryrefslogtreecommitdiff
path: root/src/mod_http_api.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-09-23 15:17:20 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-09-23 15:17:20 +0300
commit5770946f03ba669ea867b787fbd546333a8a3814 (patch)
tree73a03717ac5d4c31e12b92c1aba3b407f3c5329c /src/mod_http_api.erl
parentFix unicode formatting in ACME module (diff)
Correctly handle unicode in log messages
Diffstat (limited to 'src/mod_http_api.erl')
-rw-r--r--src/mod_http_api.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl
index 9a694a672..34e118cc9 100644
--- a/src/mod_http_api.erl
+++ b/src/mod_http_api.erl
@@ -255,7 +255,7 @@ handle(Call, Auth, Args, Version) when is_atom(Call), is_list(Args) ->
?EX_RULE(Class, Error, Stack) ->
StackTrace = ?EX_STACK(Stack),
?ERROR_MSG("REST API Error: "
- "~s(~p) -> ~p:~p ~p",
+ "~ts(~p) -> ~p:~p ~p",
[Call, hide_sensitive_args(Args),
Class, Error, StackTrace]),
{500, <<"internal_error">>}
@@ -286,7 +286,7 @@ get_elem_delete(Call, A, L, F) ->
case proplists:get_all_values(A, L) of
[Value] -> {Value, proplists:delete(A, L)};
[_, _ | _] ->
- ?INFO_MSG("Command ~s call rejected, it has duplicate attribute ~w",
+ ?INFO_MSG("Command ~ts call rejected, it has duplicate attribute ~w",
[Call, A]),
throw({invalid_parameter,
io_lib:format("Request have duplicate argument: ~w", [A])});
@@ -295,7 +295,7 @@ get_elem_delete(Call, A, L, F) ->
{list, _} ->
{[], L};
_ ->
- ?INFO_MSG("Command ~s call rejected, missing attribute ~w",
+ ?INFO_MSG("Command ~ts call rejected, missing attribute ~w",
[Call, A]),
throw({invalid_parameter,
io_lib:format("Request have missing argument: ~w", [A])})
@@ -318,7 +318,7 @@ format_args(Call, Args, ArgsFormat) ->
[] -> R;
L when is_list(L) ->
ExtraArgs = [N || {N, _} <- L],
- ?INFO_MSG("Command ~s call rejected, it has unknown arguments ~w",
+ ?INFO_MSG("Command ~ts call rejected, it has unknown arguments ~w",
[Call, ExtraArgs]),
throw({invalid_parameter,
io_lib:format("Request have unknown arguments: ~w", [ExtraArgs])})
@@ -506,9 +506,9 @@ json_error(HTTPCode, JSONCode, Message) ->
log(Call, Args, {Addr, Port}) ->
AddrS = misc:ip_to_list({Addr, Port}),
- ?INFO_MSG("API call ~s ~p from ~s:~p", [Call, hide_sensitive_args(Args), AddrS, Port]);
+ ?INFO_MSG("API call ~ts ~p from ~ts:~p", [Call, hide_sensitive_args(Args), AddrS, Port]);
log(Call, Args, IP) ->
- ?INFO_MSG("API call ~s ~p (~p)", [Call, hide_sensitive_args(Args), IP]).
+ ?INFO_MSG("API call ~ts ~p (~p)", [Call, hide_sensitive_args(Args), IP]).
hide_sensitive_args(Args=[_H|_T]) ->
lists:map( fun({<<"password">>, Password}) -> {<<"password">>, ejabberd_config:may_hide_data(Password)};