couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [1/7] chttpd commit: updated refs/heads/1993-bigcouch-couch-mrview to 93c771d
Date Fri, 28 Mar 2014 18:45:51 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/1993-bigcouch-couch-mrview a93a9ab18 -> 93c771d6f (forced update)


Switch to couch_log


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

Branch: refs/heads/1993-bigcouch-couch-mrview
Commit: 30e7912a8524cc8833d19e452519372f94215a2d
Parents: a1b8b07
Author: Robert Newson <robert.newson@cloudant.com>
Authored: Wed Feb 12 20:10:59 2014 +0000
Committer: Robert Newson <robert.newson@cloudant.com>
Committed: Wed Feb 12 20:10:59 2014 +0000

----------------------------------------------------------------------
 src/chttpd.app.src     |  2 +-
 src/chttpd.erl         | 10 +++++-----
 src/chttpd_db.erl      |  4 ++--
 src/chttpd_rewrite.erl |  4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/30e7912a/src/chttpd.app.src
----------------------------------------------------------------------
diff --git a/src/chttpd.app.src b/src/chttpd.app.src
index 9ab91c8..3ce0c72 100644
--- a/src/chttpd.app.src
+++ b/src/chttpd.app.src
@@ -32,7 +32,7 @@
     {applications, [
         kernel,
         stdlib,
-        twig,
+        couch_log,
         config,
         couch,
         fabric

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/30e7912a/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index b7f8013..4c6cfc4 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -168,7 +168,7 @@ handle_request(MochiReq) ->
     MethodOverride = MochiReq:get_primary_header_value("X-HTTP-Method-Override"),
     Method2 = case lists:member(MethodOverride, ["GET", "HEAD", "POST", "PUT", "DELETE",
"TRACE", "CONNECT", "COPY"]) of
     true ->
-        twig:log(notice, "MethodOverride: ~s (real method was ~s)", [MethodOverride, Method1]),
+        couch_log:log(notice, "MethodOverride: ~s (real method was ~s)", [MethodOverride,
Method1]),
         case Method1 of
         'POST' -> couch_util:to_existing_atom(MethodOverride);
         _ ->
@@ -215,7 +215,7 @@ handle_request(MochiReq) ->
         throw:{invalid_json, _} ->
             send_error(HttpReq, {bad_request, "invalid UTF-8 JSON"});
         exit:{mochiweb_recv_error, E} ->
-            twig:log(notice, LogForClosedSocket ++ " - ~p", [E]),
+            couch_log:log(notice, LogForClosedSocket ++ " - ~p", [E]),
             exit(normal);
         throw:Error ->
             send_error(HttpReq, Error);
@@ -231,7 +231,7 @@ handle_request(MochiReq) ->
                     exit(normal); % Client disconnect (R14)
                 _Else ->
                     JsonStack = json_stack({Error, nil, Stack}),
-                    twig:log(error, "req_err ~p:~p ~p", [Tag, Error, JsonStack]),
+                    couch_log:log(error, "req_err ~p:~p ~p", [Tag, Error, JsonStack]),
                     send_error(HttpReq, {Error, nil, Stack})
             end
     end,
@@ -246,7 +246,7 @@ handle_request(MochiReq) ->
         {aborted, Resp:get(code)}
     end,
     Host = MochiReq:get_header_value("Host"),
-    twig:log(notice, "~s ~s ~s ~s ~B ~p ~B", [Peer, Host,
+    couch_log:log(notice, "~s ~s ~s ~s ~B ~p ~B", [Peer, Host,
         atom_to_list(Method1), RawUri, Code, Status, round(RequestTime)]),
     couch_stats_collector:record({couchdb, request_time}, RequestTime),
     case Result of
@@ -255,7 +255,7 @@ handle_request(MochiReq) ->
         {ok, Resp};
     {aborted, _, Reason} ->
         couch_stats_collector:increment({httpd, aborted_requests}),
-        twig:log(error, "Response abnormally terminated: ~p", [Reason]),
+        couch_log:log(error, "Response abnormally terminated: ~p", [Reason]),
         exit(normal)
     end.
 

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/30e7912a/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index de99828..eb1a1c0 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -234,7 +234,7 @@ db_req(#httpd{method='POST', path_parts=[DbName], user_ctx=Ctx}=Req, Db)
->
                 {ok, _} -> ok;
                 {accepted, _} -> ok;
                 Error ->
-                    twig:log(debug, "Batch doc error (~s): ~p",[DocId, Error])
+                    couch_log:log(debug, "Batch doc error (~s): ~p",[DocId, Error])
                 end
             end),
 
@@ -646,7 +646,7 @@ db_doc_req(#httpd{method='PUT', user_ctx=Ctx}=Req, Db, DocId) ->
                     {ok, _} -> ok;
                     {accepted, _} -> ok;
                     Error ->
-                        twig:log(notice, "Batch doc error (~s): ~p",[DocId, Error])
+                        couch_log:log(notice, "Batch doc error (~s): ~p",[DocId, Error])
                     end
                 end),
             send_json(Req, 202, [], {[

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/30e7912a/src/chttpd_rewrite.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_rewrite.erl b/src/chttpd_rewrite.erl
index a18fa00..c8df271 100644
--- a/src/chttpd_rewrite.erl
+++ b/src/chttpd_rewrite.erl
@@ -165,7 +165,7 @@ handle_rewrite_req(#httpd{
             % normalize final path (fix levels "." and "..")
             RawPath1 = ?b2l(iolist_to_binary(normalize_path(RawPath))),
 
-            twig:log(debug, "rewrite to ~p ~n", [RawPath1]),
+            couch_log:log(debug, "rewrite to ~p ~n", [RawPath1]),
 
             % build a new mochiweb request
             MochiReq1 = mochiweb_request:new(MochiReq:get(socket),
@@ -415,7 +415,7 @@ path_to_list([<<"..">>|R], Acc, DotDotCount) when DotDotCount
== 2 ->
     "false" ->
         path_to_list(R, [<<"..">>|Acc], DotDotCount+1);
     _Else ->
-        twig:log(notice, "insecure_rewrite_rule ~p blocked", [lists:reverse(Acc) ++ [<<"..">>]
++ R]),
+        couch_log:log(notice, "insecure_rewrite_rule ~p blocked", [lists:reverse(Acc) ++
[<<"..">>] ++ R]),
         throw({insecure_rewrite_rule, "too many ../.. segments"})
     end;
 path_to_list([<<"..">>|R], Acc, DotDotCount) ->


Mime
View raw message