couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject [25/50] lager commit: updated refs/heads/import-master to da4419e
Date Thu, 13 Feb 2014 16:43:27 GMT
Add tracing support for metadata notfound


Project: http://git-wip-us.apache.org/repos/asf/couchdb-lager/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-lager/commit/d093edea
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-lager/tree/d093edea
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-lager/diff/d093edea

Branch: refs/heads/import-master
Commit: d093edea44b246ee640e879c0f55c23ac80b4bc1
Parents: d65b91a
Author: Pedram Nimreezi <deadzen@deadzen.com>
Authored: Thu Jan 23 18:15:39 2014 -0500
Committer: Andrew Thompson <andrew@hijacked.us>
Committed: Thu Jan 23 22:22:21 2014 -0500

----------------------------------------------------------------------
 src/lager_util.erl          | 3 +++
 test/lager_test_backend.erl | 9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/d093edea/src/lager_util.erl
----------------------------------------------------------------------
diff --git a/src/lager_util.erl b/src/lager_util.erl
index ae88d19..9980fb2 100644
--- a/src/lager_util.erl
+++ b/src/lager_util.erl
@@ -392,6 +392,7 @@ validate_trace_filter(Filter) when is_tuple(Filter), is_atom(element(1,
Filter))
     false;
 validate_trace_filter(Filter) ->
         case lists:all(fun({Key, '*'}) when is_atom(Key) -> true; 
+                          ({Key, '!'}) when is_atom(Key) -> true;
                           ({Key, _Value})      when is_atom(Key) -> true;
                           ({Key, '=', _Value}) when is_atom(Key) -> true;
                           ({Key, '<', _Value}) when is_atom(Key) -> true;
@@ -416,6 +417,8 @@ trace_acc([], Acc) ->
 	lists:reverse(Acc);
 trace_acc([{Key, '*'}|T], Acc) ->
 	trace_acc(T, [glc:wc(Key)|Acc]);
+trace_acc([{Key, '!'}|T], Acc) ->
+	trace_acc(T, [glc:nf(Key)|Acc]);
 trace_acc([{Key, Val}|T], Acc) ->
 	trace_acc(T, [glc:eq(Key, Val)|Acc]);
 trace_acc([{Key, '=', Val}|T], Acc) ->

http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/d093edea/test/lager_test_backend.erl
----------------------------------------------------------------------
diff --git a/test/lager_test_backend.erl b/test/lager_test_backend.erl
index c3e2329..9ce43fc 100644
--- a/test/lager_test_backend.erl
+++ b/test/lager_test_backend.erl
@@ -388,10 +388,15 @@ lager_test_() ->
                         lager:info([{requestid, 8}], "hello world"),
                         lager:info([{requestid, 9}, {foo, bar}], "hello world"),
                         lager:info([{requestid, 10}], "hello world"),
-                        ?assertEqual(7, count()),
+                        lager:trace(?MODULE, [{fu, '!'}]),
+                        lager:info([{foo, bar}], "hello world"),
+                        lager:info([{ooh, car}], "hello world"),
+                        lager:trace(?MODULE, [{fu, '*'}]),
+                        lager:info([{fu, bar}], "hello world"),
+                        ?assertEqual(10, count()),
                         lager:clear_all_traces(),
                         lager:info([{requestid, 6}], "hello world"),
-                        ?assertEqual(7, count()),
+                        ?assertEqual(10, count()),
                         ok
                 end
             },


Mime
View raw message