You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by cm...@apache.org on 2008/05/26 11:24:17 UTC

svn commit: r660140 - in /incubator/couchdb/trunk: THANKS share/server/main.js

Author: cmlenz
Date: Mon May 26 02:24:17 2008
New Revision: 660140

URL: http://svn.apache.org/viewvc?rev=660140&view=rev
Log:
Applied patch to enable logging from Javascript view functions. Closes COUCHDB-59. Thanks to Chris Anderson for the patch.

Modified:
    incubator/couchdb/trunk/THANKS
    incubator/couchdb/trunk/share/server/main.js

Modified: incubator/couchdb/trunk/THANKS
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/THANKS?rev=660140&r1=660139&r2=660140&view=diff
==============================================================================
--- incubator/couchdb/trunk/THANKS (original)
+++ incubator/couchdb/trunk/THANKS Mon May 26 02:24:17 2008
@@ -6,6 +6,7 @@
 CouchDB by reporting problems, suggesting various improvements or submitting
 changes. A list of these people is included below.
 
+ * Chris Anderson <jc...@grabb.it>
  * William Beh <wi...@gmail.com>
  * Benoit Chesneau <bc...@gmail.com>
  * Till Klampaeckel <ti...@klampaeckel.de>

Modified: incubator/couchdb/trunk/share/server/main.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/server/main.js?rev=660140&r1=660139&r2=660140&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/server/main.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/server/main.js [utf-8] Mon May 26 02:24:17 2008
@@ -28,11 +28,16 @@
   return rv;
 }
 
+log = function(message) {
+  print(toJSON({log: toJSON(message)}));  
+}
+
 try {
   // if possible, use evalcx (not always available)
   sandbox = evalcx('');
   sandbox.emit = emit;
   sandbox.sum = sum;
+  sandbox.log = log;
 } catch (e) {}
 
 // Commands are in the form of json arrays: