Selaa lähdekoodia

Merge pull request #192 from basho/adt-fix-empty-binary-printing

Remove the workaround for the bug when printing empty binaries in W mode
pull/193/head
Andrew Thompson 11 vuotta sitten
vanhempi
commit
da0e4cae00
3 muutettua tiedostoa jossa 8 lisäystä ja 10 poistoa
  1. +1
    -1
      rebar.config
  2. +5
    -8
      src/lager_trunc_io.erl
  3. +2
    -1
      src/lager_util.erl

+ 1
- 1
rebar.config Näytä tiedosto

@ -1,7 +1,7 @@
{erl_opts, [debug_info, warn_untyped_record]}.
{erl_first_files, ["src/lager_util.erl"]}.
{deps, [
{goldrush, ".*",
{goldrush, "0\.1\.6",
{git, "git://github.com/DeadZen/goldrush.git", {tag, "0.1.6"}}}
]}.

+ 5
- 8
src/lager_trunc_io.erl Näytä tiedosto

@ -127,13 +127,10 @@ print(Atom, _Max, #print_options{force_strings=NoQuote}) when is_atom(Atom) ->
end,
{R, length(R)};
print(Bin, _Max, O = #print_options{depth=1}) when is_binary(Bin) ->
case O#print_options.lists_as_strings of
true when Bin == <<>> ->
{"<<>>", 4};
_ ->
{"<<...>>", 7}
end;
print(<<>>, _Max, #print_options{depth=1}) ->
{"<<>>", 4};
print(Bin, _Max, #print_options{depth=1}) when is_binary(Bin) ->
{"<<...>>", 7};
print(<<>>, _Max, Options) ->
case Options#print_options.force_strings of
true ->
@ -766,7 +763,7 @@ depth_limit_test() ->
%% I don't even know...
?assertEqual("<<>>", lists:flatten(format("~P", [<<>>, 1], 50))),
?assertEqual("<<...>>", lists:flatten(format("~W", [<<>>, 1], 50))),
?assertEqual("<<>>", lists:flatten(format("~W", [<<>>, 1], 50))),
?assertEqual("{abc,<<\"abc\\\"\">>}", lists:flatten(format("~P", [{abc,<<"abc\"">>}, 4], 50))),

+ 2
- 1
src/lager_util.erl Näytä tiedosto

@ -587,6 +587,7 @@ rotate_file_fail_test() ->
ok.
check_trace_test() ->
lager:start(),
trace_filter(none),
%% match by module
?assertEqual([foo], check_traces([{module, ?MODULE}], ?EMERGENCY, [
@ -627,7 +628,7 @@ check_trace_test() ->
{[{module, '*'}], config_to_mask('!=info'), anythingbutinfo},
{[{module, '*'}], config_to_mask('!=notice'), anythingbutnotice}
], [])),
application:stop(lager),
ok.
is_loggable_test_() ->

Ladataan…
Peruuta
Tallenna