From 4c7bd96d626c10fb26fee3b5add4593e404d3295 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Fri, 24 Jan 2014 00:09:26 -0500 Subject: [PATCH 1/3] Remove the workaround for the bug when printing empty binaries in W mode The fix for this was merged in R16 somewhere, so this workaround is no longer needed, and fixes the EQC test from spotting the divergent behaviour with io_lib. See also: http://erlang.org/pipermail/erlang-patches/2012-September/003034.html --- src/lager_trunc_io.erl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 @@ 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))), From 6ab08dc097bbd89bcc7120fcf8c814a0e43a6c4d Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Fri, 24 Jan 2014 00:28:27 -0500 Subject: [PATCH 2/3] Fix test run on OSX --- src/lager_util.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lager_util.erl b/src/lager_util.erl index 9980fb2..6654dd9 100644 --- a/src/lager_util.erl +++ b/src/lager_util.erl @@ -588,6 +588,7 @@ rotate_file_fail_test() -> ok. check_trace_test() -> + lager:start(), trace_filter(none), %% match by module ?assertEqual([foo], check_traces([{module, ?MODULE}], ?EMERGENCY, [ @@ -628,7 +629,7 @@ check_trace_test() -> {[{module, '*'}], config_to_mask('!=info'), anythingbutinfo}, {[{module, '*'}], config_to_mask('!=notice'), anythingbutnotice} ], [])), - + application:stop(lager), ok. is_loggable_test_() -> From 017a5167fa222d9df15876ec6907454c1c84f4ef Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Fri, 24 Jan 2014 00:39:08 -0500 Subject: [PATCH 3/3] Force goldrush to version 0.1.6 --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 4278d3e..ec113f5 100644 --- a/rebar.config +++ b/rebar.config @@ -1,7 +1,7 @@ {erl_opts, [debug_info]}. {erl_first_files, ["src/lager_util.erl"]}. {deps, [ - {goldrush, ".*", + {goldrush, "0\.1\.6", {git, "git://github.com/DeadZen/goldrush.git", {tag, "0.1.6"}}} ]}.