blob: 579c678f25d4001a350e7c6a42d8dc2632e0b89c [file] [log] [blame]
/*
* This class provides access to the debugging console.
* @constructor
*/
function DebugConsole() {
};
/*
* Print a normal log message to the console
* @param {Object|String} message Message or object to print to the console
*/
DebugConsole.prototype.log = function(message) {
if (typeof message == 'object')
message = Object.toJSON(message);
this.error(message);
//this isn't working on the device
/*
if (typeof Mojo != 'undefined')
Mojo.Log.info(message);
*/
};
/*
* Print a warning message to the console
* @param {Object|String} message Message or object to print to the console
*/
DebugConsole.prototype.warn = function(message) {
if (typeof message == 'object')
message = Object.toJSON(message);
this.error(message);
//this isn't working on the device
/*
if (typeof Mojo != 'undefined')
Mojo.Log.warn(message);
*/
};
/**
* Print an error message to the console
* @param {Object|String} message Message or object to print to the console
*/
DebugConsole.prototype.error = function(message) {
if (typeof message == 'object')
message = Object.toJSON(message);
//if (typeof Mojo != 'undefined')
// Mojo.Log.error(message);
//console.log(JSON.stringify(message));
console.log(message);
};
if (typeof window.debug == "undefined") window.debug = new DebugConsole();