25 lines
675 B
JavaScript
25 lines
675 B
JavaScript
(function(context) {
|
|
|
|
/*
|
|
internal logger with no-ops when console is missing.
|
|
*/
|
|
context.JK = context.JK || {};
|
|
|
|
var console_methods = [
|
|
'log', 'debug', 'info', 'warn', 'error', 'assert',
|
|
'clear', 'dir', 'dirxml', 'trace', 'group',
|
|
'groupCollapsed', 'groupEnd', 'time', 'timeEnd',
|
|
'timeStamp', 'profile', 'profileEnd', 'count',
|
|
'exception', 'table'
|
|
];
|
|
|
|
if ('undefined' === typeof(context.console)) {
|
|
context.console = {};
|
|
$.each(console_methods, function(index, value) {
|
|
context.console[value] = $.noop;
|
|
});
|
|
}
|
|
|
|
context.JK.logger = context.console;
|
|
|
|
}(window)); |