authenticated: false,
authenticating: false,
active: false,
+ logger: undefined,
log_level: 1, // Will be overridden from mkws.config, but
// initial value allows jQuery popup to use logging.
teams: {},
mkws.$ = jQuery;
}
+mkws.logger = JL('mkws');
+var consoleAppender = JL.createConsoleAppender('consoleAppender');
+mkws.logger.setOptions({ "appenders": [consoleAppender]} );
+
+
mkws.log = function(string) {
if (!mkws.log_level)
return;
- if (typeof console === "undefined" || typeof console.log === "undefined") { /* ARGH!!! old IE */
- return;
- }
-
// you need to disable use strict at the top of the file!!!
if (mkws.log_level >= 3) {
// Works in Chrome; not sure about elsewhere
} else if (mkws.log_level >= 2) {
console.log(">>> called from function " + arguments.callee.caller.name + ' <<<');
}
- console.log(string);
+ mkws.logger.info(string);
};