couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couchdb-mango git commit: Convert from twig to couch_log
Date Sun, 08 Feb 2015 13:56:37 GMT
Repository: couchdb-mango
Updated Branches:
  refs/heads/master bf2bfa80d -> 571c757aa


Convert from twig to couch_log


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

Branch: refs/heads/master
Commit: 571c757aa9d9d01e6afd1c1129bf4a22274452ce
Parents: bf2bfa8
Author: Robert Newson <rnewson@apache.org>
Authored: Sun Feb 8 13:56:28 2015 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Sun Feb 8 13:56:28 2015 +0000

----------------------------------------------------------------------
 src/mango.app.src         | 2 +-
 src/mango_cursor_view.erl | 8 +-------
 src/mango_httpd.erl       | 1 -
 src/mango_util.erl        | 7 +++----
 4 files changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/571c757a/src/mango.app.src
----------------------------------------------------------------------
diff --git a/src/mango.app.src b/src/mango.app.src
index 7bd5d74..a25cf1e 100644
--- a/src/mango.app.src
+++ b/src/mango.app.src
@@ -18,7 +18,7 @@
         kernel,
         stdlib,
         config,
-        twig,
+        couch_log,
         fabric
     ]}
 ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/571c757a/src/mango_cursor_view.erl
----------------------------------------------------------------------
diff --git a/src/mango_cursor_view.erl b/src/mango_cursor_view.erl
index d3d1db1..9e992f9 100644
--- a/src/mango_cursor_view.erl
+++ b/src/mango_cursor_view.erl
@@ -75,13 +75,11 @@ execute(#cursor{db = Db, index = Idx} = Cursor0, UserFun, UserAcc) ->
     CB = fun ?MODULE:handle_message/2,
     {ok, LastCursor} = case mango_idx:def(Idx) of
         all_docs ->
-            %twig:log(err, "Query: ~s all_docs~n  ~p", [Db#db.name, Args]),
             fabric:all_docs(Db, CB, Cursor, Args);
         _ ->
             % Normal view
             DDoc = ddocid(Idx),
             Name = mango_idx:name(Idx),
-            %twig:log(err, "Query: ~s ~s ~s~n  ~p", [Db#db.name, DDoc, Name, Args]),
             fabric:query_view(Db, DDoc, Name, CB, Cursor, Args)
     end,
     {ok, LastCursor#cursor.user_acc}.
@@ -137,10 +135,8 @@ choose_best_index(_DbName, IndexRanges) ->
 
 
 handle_message({total_and_offset, _, _} = _TO, Cursor) ->
-    %twig:log(err, "TOTAL AND OFFSET: ~p", [_TO]),
     {ok, Cursor};
 handle_message({row, {Props}}, Cursor) ->
-    %twig:log(err, "ROW: ~p", [Props]),
     case doc_member(Cursor#cursor.db, Props, Cursor#cursor.opts) of
         {ok, Doc} ->
             case mango_selector:match(Cursor#cursor.selector, Doc) of
@@ -151,14 +147,12 @@ handle_message({row, {Props}}, Cursor) ->
                     {ok, Cursor}
             end;
         Error ->
-            twig:log(err, "~s :: Error loading doc: ~p", [?MODULE, Error]),
+            couch_log:error("~s :: Error loading doc: ~p", [?MODULE, Error]),
             {ok, Cursor}
     end;
 handle_message(complete, Cursor) ->
-    %twig:log(err, "COMPLETE", []),
     {ok, Cursor};
 handle_message({error, Reason}, _Cursor) ->
-    %twig:log(err, "ERROR: ~p", [Reason]),
     {error, Reason}.
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/571c757a/src/mango_httpd.erl
----------------------------------------------------------------------
diff --git a/src/mango_httpd.erl b/src/mango_httpd.erl
index ed1e9bc..2588a23 100644
--- a/src/mango_httpd.erl
+++ b/src/mango_httpd.erl
@@ -29,7 +29,6 @@ handle_req(#httpd{} = Req, Db0) ->
     catch
         throw:{mango_error, Module, Reason} ->
             %Stack = erlang:get_stacktrace(),
-            %twig:log(err, "Error: ~s :: ~w~n~p", [Module, Reason, Stack]),
             {Code, ErrorStr, ReasonStr} = mango_error:info(Module, Reason),
             Resp = {[
                 {<<"error">>, ErrorStr},

http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/571c757a/src/mango_util.erl
----------------------------------------------------------------------
diff --git a/src/mango_util.erl b/src/mango_util.erl
index f350710..8e8ccb4 100644
--- a/src/mango_util.erl
+++ b/src/mango_util.erl
@@ -79,7 +79,6 @@ load_ddoc(Db, DDocId) ->
 
 
 defer(Mod, Fun, Args) ->
-    %twig:log(error, "MFA: ~p", [{Mod, Fun, Args}]),
     {Pid, Ref} = erlang:spawn_monitor(?MODULE, do_defer, [Mod, Fun, Args]),
     receive
         {'DOWN', Ref, process, Pid, {mango_defer_ok, Value}} ->
@@ -100,15 +99,15 @@ do_defer(Mod, Fun, Args) ->
     catch
         throw:Error ->
             Stack = erlang:get_stacktrace(),
-            twig:log(err, "Defered error: ~w~n    ~p", [{throw, Error}, Stack]),
+            couch_log:error("Defered error: ~w~n    ~p", [{throw, Error}, Stack]),
             erlang:exit({mango_defer_throw, Error});
         error:Error ->
             Stack = erlang:get_stacktrace(),
-            twig:log(err, "Defered error: ~w~n    ~p", [{error, Error}, Stack]),
+            couch_log:error("Defered error: ~w~n    ~p", [{error, Error}, Stack]),
             erlang:exit({mango_defer_error, Error});
         exit:Error ->
             Stack = erlang:get_stacktrace(),
-            twig:log(err, "Defered error: ~w~n    ~p", [{exit, Error}, Stack]),
+            couch_log:error("Defered error: ~w~n    ~p", [{exit, Error}, Stack]),
             erlang:exit({mango_defer_exit, Error})
     end.
 


Mime
View raw message