From couchdb-dev-return-421-apmail-incubator-couchdb-dev-archive=incubator.apache.org@incubator.apache.org Sat May 24 23:32:05 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-dev-archive@locus.apache.org Received: (qmail 81124 invoked from network); 24 May 2008 23:32:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 May 2008 23:32:05 -0000 Received: (qmail 16778 invoked by uid 500); 24 May 2008 23:32:06 -0000 Delivered-To: apmail-incubator-couchdb-dev-archive@incubator.apache.org Received: (qmail 16741 invoked by uid 500); 24 May 2008 23:32:06 -0000 Mailing-List: contact couchdb-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-dev@incubator.apache.org Received: (qmail 16730 invoked by uid 99); 24 May 2008 23:32:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 May 2008 16:32:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 209.85.162.182 as permitted sender) Received: from [209.85.162.182] (HELO el-out-1112.google.com) (209.85.162.182) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 May 2008 23:31:18 +0000 Received: by el-out-1112.google.com with SMTP id j27so612297elf.18 for ; Sat, 24 May 2008 16:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=s0s+FJ9u+j5UneUVHFQ11JwGhx8ukIuGzK51GdunFxk=; b=nIzDao0ILGOIvbNyv1cXtrIsW6j+MWoMPOe7XpSt6pBVwJzGFu5J6eY1nw2viIHymygm6tMhFUwUpCl0tKGmALi+JHp2DDETYgy8H431Hx8RwxV0rregGUotTlxAVFGWCJJaqN9J21zCxl+isw519ZfdPvzxB9SLH0ufx5RhGSM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=f6MfuDAY4DKD0dPsV8eBUBVf643Z2K7+rXBrPDqgVcKM7pYKRYZTXpfGjpK4M6uJWs7H9F2jhC/T6kG+f7LADxBowlZ4xkIM5LwOXpu5JwLmGMvYt0lKxHmxgIqorR0iea305n1Js0zdrp6ZsYDVQ1my2gVFFY7Bt707zL+4LJA= Received: by 10.115.58.1 with SMTP id l1mr3616374wak.110.1211671893638; Sat, 24 May 2008 16:31:33 -0700 (PDT) Received: by 10.114.102.7 with HTTP; Sat, 24 May 2008 16:31:33 -0700 (PDT) Message-ID: Date: Sat, 24 May 2008 16:31:33 -0700 From: "Chris Anderson" Sender: jchris@gmail.com To: couchdb-dev@incubator.apache.org Subject: logging from views MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 26b8196f373c160a X-Virus-Checked: Checked by ClamAV on apache.org I've been playing with views, and finding the new Reduce a little confusing. To get a better idea about what's happening I added a log() function to the view context, that prints to couchjs stderr (which I redirect to a log file). Here's the diff: http://pastie.caboo.se/202877 I don't think CouchDB cares about view server stderr, so it seems handy to make it available to view functions for debugging. The only thing I'm not sure of is couchjs.tpl.in - maybe there's a better way to redirect stderr. Also, I don't know which template variable corresponds to the log directory, so it's still hardcoded. I want to polish this and road test it before I add it to JIRA, any feedback will be appreciated! Chris -- Chris Anderson http://jchris.mfdz.com