add SILENT_DEBUG option, and make that log to the browser console
This commit is contained in:
parent
8ad224edad
commit
237c4ccec2
|
@ -1,6 +1,7 @@
|
|||
var cah = {};
|
||||
|
||||
cah.DEBUG = true;
|
||||
cah.DEBUG = false;
|
||||
cah.SILENT_DEBUG = true;
|
||||
|
||||
/**
|
||||
* This client's nickname.
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue