summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2010-11-15 00:04:47 +0000
committerJan Lehnardt <jan@apache.org>2010-11-15 00:04:47 +0000
commitba8d3e93235e1bcccdeeb03d130aaad2c9988237 (patch)
treebe9d4cda0299a8c3487e44c259dc72718ceb6981
parent9f8e7b9b5eb12a173cbc18a88a990558f4b9aebd (diff)
Avoid lengthy stack traces for log(undefined);
Improve log(<xml/>); Patch by Benjamin Young. Closes COUCHDB-895. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035104 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--THANKS1
-rw-r--r--share/server/util.js6
2 files changed, 5 insertions, 2 deletions
diff --git a/THANKS b/THANKS
index e6d7e87f..4ba0ece8 100644
--- a/THANKS
+++ b/THANKS
@@ -72,5 +72,6 @@ suggesting improvements or submitting changes. Some of these people are:
* Dale Harvey <dale@arandomurl.com>
* Juuso Väänänen <juuso@vaananen.org>
* Jeff Zellner <jeff.zellner@gmail.com>
+ * Benjamin Young <byoung@bigbluehat.com>
For a list of authors see the `AUTHORS` file.
diff --git a/share/server/util.js b/share/server/util.js
index 77b934ed..a5dfa127 100644
--- a/share/server/util.js
+++ b/share/server/util.js
@@ -117,8 +117,10 @@ function respond(obj) {
function log(message) {
// idea: query_server_config option for log level
- if (typeof message != "string") {
+ if (typeof message == "xml") {
+ message = message.toXMLString();
+ } else if (typeof message != "string") {
message = Couch.toJSON(message);
}
- respond(["log", message]);
+ respond(["log", String(message)]);
};