summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-05-26 09:24:17 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-05-26 09:24:17 +0000
commit93bff3757982cc505a87addc610816ed54982f84 (patch)
treeb5ade2b73a3f620a3f35ea6c6bf5c1898f93e932 /share
parent52d0dc95166dbbcd293afb3bfca6ca8533c00270 (diff)
Applied patch to enable logging from Javascript view functions. Closes COUCHDB-59. Thanks to Chris Anderson for the patch.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@660140 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/server/main.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/server/main.js b/share/server/main.js
index a62ed1ff..7fe08608 100644
--- a/share/server/main.js
+++ b/share/server/main.js
@@ -28,11 +28,16 @@ sum = function(values) {
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: