From ba8d3e93235e1bcccdeeb03d130aaad2c9988237 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Mon, 15 Nov 2010 00:04:47 +0000 Subject: Avoid lengthy stack traces for log(undefined); Improve log(); Patch by Benjamin Young. Closes COUCHDB-895. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035104 13f79535-47bb-0310-9956-ffa450edef68 --- share/server/util.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'share') 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)]); }; -- cgit v1.2.3