Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C4AE10B3D for ; Wed, 12 Feb 2014 23:47:02 +0000 (UTC) Received: (qmail 49667 invoked by uid 500); 12 Feb 2014 23:47:01 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 49568 invoked by uid 500); 12 Feb 2014 23:47:01 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 49560 invoked by uid 99); 12 Feb 2014 23:47:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 23:47:01 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.214.173 as permitted sender) Received: from [209.85.214.173] (HELO mail-ob0-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 23:46:56 +0000 Received: by mail-ob0-f173.google.com with SMTP id vb8so11299450obc.4 for ; Wed, 12 Feb 2014 15:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=sfor0REmk5Ldy57f83y3IyGXKq+BdNx5+V6/EOc+/uw=; b=P/Yh490kWwiUiHI5PzL5Fr6Qhfgayaeo9bWOB6PuvlniBEmAEefl2jBlJJBm6Qq8Pm 5amin8HxDVYi3dVK+FQKSFYnjz6roNsiAedQvG14LLdiJM9Sw4HJFBIORhZXFGOH/YoS 1+PM2BCWgwybxb5KeW3OJRGPB99A+2FwdEKDply0Nt2PU5R+g+ax7YPMUQlNaOl3yoTs IL0Hr8Vr0AHr13ielAVovhLGlOSaYStM8XQg40Zs8xA0AxnNsQlGL2fJvbuAViIBHBSV X2X4zHl9Bf0yJ4tINGdDjQ0DDiswosJv0EhKYe9blS5rx6E66Dcv+v6tA5atIwlxpx5k Qrtg== X-Received: by 10.182.243.138 with SMTP id wy10mr35609obc.83.1392248795252; Wed, 12 Feb 2014 15:46:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.162.36 with HTTP; Wed, 12 Feb 2014 15:45:55 -0800 (PST) In-Reply-To: References: From: Paul Davis Date: Wed, 12 Feb 2014 17:45:55 -0600 Message-ID: Subject: Re: chttpd commit: updated refs/heads/1843-feature-bigcouch to faaf44e To: "dev@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Twas me. Too many scars from accidentally doing twig:log("format: ~p", [Arg]) to let that one go. On Wed, Feb 12, 2014 at 5:43 PM, Adam Kocoloski wrote: > I was about to suggest the same ... who beat me to it? > > Adam > > On Feb 12, 2014, at 6:22 PM, rnewson@apache.org wrote: > >> Updated Branches: >> refs/heads/1843-feature-bigcouch 927a8d11b -> faaf44e98 >> >> >> Change API to function per level >> >> >> Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo >> Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/faaf44e9 >> Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/faaf44e9 >> Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/faaf44e9 >> >> Branch: refs/heads/1843-feature-bigcouch >> Commit: faaf44e987580b884961a910f862462f22f0d98d >> Parents: 927a8d1 >> Author: Robert Newson >> Authored: Wed Feb 12 23:22:44 2014 +0000 >> Committer: Robert Newson >> Committed: Wed Feb 12 23:22:44 2014 +0000 >> >> ---------------------------------------------------------------------- >> src/chttpd.erl | 10 +++++----- >> src/chttpd_db.erl | 4 ++-- >> src/chttpd_rewrite.erl | 4 ++-- >> 3 files changed, 9 insertions(+), 9 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/faaf44e9/src/chttpd.erl >> ---------------------------------------------------------------------- >> diff --git a/src/chttpd.erl b/src/chttpd.erl >> index 2ff7189..7504db4 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 -> >> - couch_log:log(notice, "MethodOverride: ~s (real method was ~s)", [MethodOverride, Method1]), >> + couch_log:notice("MethodOverride: ~s (real method was ~s)", [MethodOverride, Method1]), >> case Method1 of >> 'POST' -> couch_util:to_existing_atom(MethodOverride); >> _ -> >> @@ -218,7 +218,7 @@ handle_request(MochiReq) -> >> throw:{invalid_json, _} -> >> send_error(HttpReq, {bad_request, "invalid UTF-8 JSON"}); >> exit:{mochiweb_recv_error, E} -> >> - couch_log:log(notice, LogForClosedSocket ++ " - ~p", [E]), >> + couch_log:notice(LogForClosedSocket ++ " - ~p", [E]), >> exit(normal); >> throw:Error -> >> send_error(HttpReq, Error); >> @@ -234,7 +234,7 @@ handle_request(MochiReq) -> >> exit(normal); % Client disconnect (R14) >> _Else -> >> JsonStack = json_stack({Error, nil, Stack}), >> - couch_log:log(error, "req_err ~p:~p ~p", [Tag, Error, JsonStack]), >> + couch_log:error("req_err ~p:~p ~p", [Tag, Error, JsonStack]), >> send_error(HttpReq, {Error, nil, Stack}) >> end >> end, >> @@ -249,7 +249,7 @@ handle_request(MochiReq) -> >> {aborted, Resp:get(code)} >> end, >> Host = MochiReq:get_header_value("Host"), >> - couch_log:log(notice, "~s ~s ~s ~s ~B ~p ~B", [Peer, Host, >> + couch_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 >> @@ -258,7 +258,7 @@ handle_request(MochiReq) -> >> {ok, Resp}; >> {aborted, _, Reason} -> >> couch_stats_collector:increment({httpd, aborted_requests}), >> - couch_log:log(error, "Response abnormally terminated: ~p", [Reason]), >> + couch_log:error("Response abnormally terminated: ~p", [Reason]), >> exit(normal) >> end. >> >> >> http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/faaf44e9/src/chttpd_db.erl >> ---------------------------------------------------------------------- >> diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl >> index eb1a1c0..0f2c5e3 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 -> >> - couch_log:log(debug, "Batch doc error (~s): ~p",[DocId, Error]) >> + couch_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 -> >> - couch_log:log(notice, "Batch doc error (~s): ~p",[DocId, Error]) >> + couch_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/faaf44e9/src/chttpd_rewrite.erl >> ---------------------------------------------------------------------- >> diff --git a/src/chttpd_rewrite.erl b/src/chttpd_rewrite.erl >> index c8df271..2a0cf64 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))), >> >> - couch_log:log(debug, "rewrite to ~p ~n", [RawPath1]), >> + couch_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 -> >> - couch_log:log(notice, "insecure_rewrite_rule ~p blocked", [lists:reverse(Acc) ++ [<<"..">>] ++ R]), >> + couch_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) -> >> >