Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E99FA11258 for ; Fri, 1 Aug 2014 09:05:46 +0000 (UTC) Received: (qmail 91496 invoked by uid 500); 1 Aug 2014 09:05:39 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 91391 invoked by uid 500); 1 Aug 2014 09:05:39 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 90004 invoked by uid 99); 1 Aug 2014 09:05:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 09:05:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 89B139BC9E4; Fri, 1 Aug 2014 09:05:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Fri, 01 Aug 2014 09:06:12 -0000 Message-Id: In-Reply-To: <43199eadd1da472cb38a627f6bbae6bf@git.apache.org> References: <43199eadd1da472cb38a627f6bbae6bf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [36/49] chttpd commit: updated refs/heads/windsor-merge to 554ef74 Improve HTTP error log formatting The use of `~p` for binaries and stacks wasn't very useful. This just changes things around as well as puts the stack on a new line indented four spaces so that its readable. BugzId: 26121 Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/d15303fb Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/d15303fb Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/d15303fb Branch: refs/heads/windsor-merge Commit: d15303fb3316e2da610241ce7fd5f238e6907e04 Parents: 3f3e916 Author: Paul J. Davis Authored: Thu Dec 12 12:38:10 2013 -0600 Committer: Robert Newson Committed: Thu Jul 31 11:55:09 2014 +0100 ---------------------------------------------------------------------- src/chttpd.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/d15303fb/src/chttpd.erl ---------------------------------------------------------------------- diff --git a/src/chttpd.erl b/src/chttpd.erl index 372a61d..a783f91 100644 --- a/src/chttpd.erl +++ b/src/chttpd.erl @@ -893,8 +893,10 @@ maybe_decompress(Httpd, Body) -> log_error_with_stack_trace({bad_request, _, _}) -> ok; log_error_with_stack_trace({Error, Reason, Stack}) -> - couch_log:error("ref: ~p req_err ~p:~p ~p", - [stack_hash(Stack), Error, Reason, Stack]); + EFmt = if is_binary(Error) -> "~s"; true -> "~w" end, + RFmt = if is_binary(Reason) -> "~s"; true -> "~w" end, + Fmt = "req_err(~w) " ++ EFmt ++ " : " ++ RFmt ++ "~n ~p", + couch_log:error(Fmt, [stack_hash(Stack), Error, Reason, Stack]); log_error_with_stack_trace(_) -> ok.