From 237c4ccec2c7d5ac7e0c9829c89ccd2d55195f93 Mon Sep 17 00:00:00 2001 From: Andy Janata Date: Sat, 28 Jan 2012 00:49:50 -0800 Subject: [PATCH] add SILENT_DEBUG option, and make that log to the browser console --- WebContent/js/cah.js | 3 ++- WebContent/js/cah.log.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WebContent/js/cah.js b/WebContent/js/cah.js index d4b4467..28662cb 100644 --- a/WebContent/js/cah.js +++ b/WebContent/js/cah.js @@ -1,6 +1,7 @@ var cah = {}; -cah.DEBUG = true; +cah.DEBUG = false; +cah.SILENT_DEBUG = true; /** * This client's nickname. diff --git a/WebContent/js/cah.log.js b/WebContent/js/cah.log.js index 6f62268..673410b 100644 --- a/WebContent/js/cah.log.js +++ b/WebContent/js/cah.log.js @@ -34,6 +34,9 @@ cah.log.error = function(text) { * opt_obj Optional. Object to dump along with message. */ cah.log.debug = function(text, opt_obj) { + if (cah.SILENT_DEBUG && console) { + console.debug("[" + new Date().toLocaleTimeString() + "]", text, opt_obj); + } if (cah.DEBUG) { if (opt_obj) { if (JSON && JSON.stringify) {