Permalink
Browse files

AZ 72: format & truncate individual terms instead of all-together

  • Loading branch information...
1 parent 7887bc4 commit 7d5bd6810f7a00444d5c42e4f4150d3d0f8dc263 @slfritchie slfritchie committed Jan 25, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/riak_err_handler.erl
View
@@ -279,8 +279,13 @@ format_event(Event, TermMaxSize, FmtMaxBytes) ->
limited_fmt(Fmt, Args, TermMaxSize, FmtMaxBytes) ->
TermSize = erts_debug:flat_size(Args),
if TermSize > TermMaxSize ->
- {Str, _} = trunc_io:print(Args, FmtMaxBytes),
- ["Oversize args for format \"", Fmt, "\": ", Str];
+ ["Oversize args for format \"", Fmt, "\": \n",
+ [
+ begin
+ {Str, _} = trunc_io:print(lists:nth(N, Args), FmtMaxBytes),
+ [" arg", integer_to_list(N), ": ", Str, "\n"]
+ end || N <- lists:seq(1, length(Args))
+ ]];
true ->
io_lib:format(Fmt, Args)
end.

0 comments on commit 7d5bd68

Please sign in to comment.