Skip to content

Commit

Permalink
Use ~0p instead of ~999999p for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
juhlig authored and essen committed Jan 23, 2025
1 parent 3810018 commit 7335184
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ranch_acceptors_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ listen_error(Ref, Transport, TransOpts0, Reason, Logger) ->
SocketOpts = hide_socket_opts(SocketOpts0),
TransOpts = TransOpts0#{socket_opts => SocketOpts},
ranch:log(error,
"Failed to start Ranch listener ~p in ~p:listen(~999999p) for reason ~p (~s)~n",
"Failed to start Ranch listener ~p in ~p:listen(~0p) for reason ~p (~s)~n",
[Ref, Transport, TransOpts, Reason, format_error(Transport, Reason)], Logger),
exit({listen_error, Ref, Reason}).

Expand Down Expand Up @@ -120,5 +120,5 @@ format_error(Transport, Reason) ->
true ->
Transport:format_error(Reason);
false ->
lists:flatten(io_lib:format("~999999p", [Reason]))
lists:flatten(io_lib:format("~0p", [Reason]))
end.
8 changes: 4 additions & 4 deletions src/ranch_conns_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ loop(State=#state{parent=Parent, ref=Ref, id=Id, conn_type=ConnType,
To ! self(),
ranch:log(error,
"Ranch listener ~p connection process start failure; "
"~p:start_link/3 returned: ~999999p~n",
"~p:start_link/3 returned: ~0p~n",
[Ref, Protocol, Ret], Logger),
Transport:close(Socket),
loop(State, CurConns, NbChildren, Sleepers)
catch Class:Reason ->
To ! self(),
ranch:log(error,
"Ranch listener ~p connection process start failure; "
"~p:start_link/3 crashed with reason: ~p:~999999p~n",
"~p:start_link/3 crashed with reason: ~p:~0p~n",
[Ref, Protocol, Class, Reason], Logger),
Transport:close(Socket),
loop(State, CurConns, NbChildren, Sleepers)
Expand Down Expand Up @@ -475,7 +475,7 @@ system_terminate(Reason, _, _, {State, _, NbChildren, _}) ->
system_code_change(Misc, _, _, _) ->
{ok, Misc}.

%% We use ~999999p here instead of ~w because the latter doesn't
%% We use ~0p here instead of ~w because the latter doesn't
%% support printable strings.
report_error(_, _, _, _, normal) ->
ok;
Expand All @@ -486,5 +486,5 @@ report_error(_, _, _, _, {shutdown, _}) ->
report_error(Logger, Ref, Protocol, Pid, Reason) ->
ranch:log(error,
"Ranch listener ~p had connection process started with "
"~p:start_link/3 at ~p exit with reason: ~999999p~n",
"~p:start_link/3 at ~p exit with reason: ~0p~n",
[Ref, Protocol, Pid, Reason], Logger).

0 comments on commit 7335184

Please sign in to comment.