Merge pull request #192 from basho/adt-fix-empty-binary-printing
Remove the workaround for the bug when printing empty binaries in W mode
diff --git a/rebar.config b/rebar.config
index 3e0b1c8..3eb95fa 100644
--- a/rebar.config
+++ b/rebar.config
@@ -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"}}}
]}.
diff --git a/src/lager_trunc_io.erl b/src/lager_trunc_io.erl
index 43b3d24..a2f2d6b 100644
--- a/src/lager_trunc_io.erl
+++ b/src/lager_trunc_io.erl
@@ -127,13 +127,10 @@
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 @@
%% 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))),
diff --git a/src/lager_util.erl b/src/lager_util.erl
index 9131439..d912103 100644
--- a/src/lager_util.erl
+++ b/src/lager_util.erl
@@ -587,6 +587,7 @@
ok.
check_trace_test() ->
+ lager:start(),
trace_filter(none),
%% match by module
?assertEqual([foo], check_traces([{module, ?MODULE}], ?EMERGENCY, [
@@ -627,7 +628,7 @@
{[{module, '*'}], config_to_mask('!=info'), anythingbutinfo},
{[{module, '*'}], config_to_mask('!=notice'), anythingbutnotice}
], [])),
-
+ application:stop(lager),
ok.
is_loggable_test_() ->