Browse Source

Default to treating lists as strings, (and set it false for ~w)

pull/25/head
Andrew Thompson 13 years ago
parent
commit
31d9529e3e
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/lager_format.erl
  2. +1
    -1
      src/lager_trunc_io.erl

+ 2
- 2
src/lager_format.erl View File

@ -205,7 +205,7 @@ control(C, A, F, Adj, P, Pad, Enc, L) ->
{{C, A, F, Adj, P, Pad, Enc}, L}.
control2($w, [A], F, Adj, P, Pad, _Enc, L) ->
Term = lager_trunc_io:fprint(A, L),
Term = lager_trunc_io:fprint(A, L, [{lists_as_strings, false}]),
Res = term(Term, F, Adj, P, Pad),
{Res, L - lists:flatlength(Res)};
control2($p, [A], F, Adj, P, Pad, _Enc, L) ->
@ -213,7 +213,7 @@ control2($p, [A], F, Adj, P, Pad, _Enc, L) ->
Res = term(Term, F, Adj, P, Pad),
{Res, L - lists:flatlength(Res)};
control2($W, [A,Depth], F, Adj, P, Pad, _Enc, L) when is_integer(Depth) ->
Term = lager_trunc_io:fprint(A, L, [{depth, Depth}]),
Term = lager_trunc_io:fprint(A, L, [{depth, Depth}, {lists_as_strings, false}]),
Res = term(Term, F, Adj, P, Pad),
{Res, L - lists:flatlength(Res)};
control2($P, [A,Depth], F, Adj, P, Pad, _Enc, L) when is_integer(Depth) ->

+ 1
- 1
src/lager_trunc_io.erl View File

@ -45,7 +45,7 @@
%% negative depth means no depth limiting
depth = -1 :: integer(),
%% whether to print lists as strings, if possible
lists_as_strings = false :: boolean(),
lists_as_strings = true :: boolean(),
%% force strings, or binaries to be printed as a string,
%% even if they're not printable
force_strings = false :: boolean()

Loading…
Cancel
Save