IE8/JS: some more console logging fixes

refs #6417
This commit is contained in:
Thomas Gelf 2014-06-06 05:23:57 +00:00
parent 2bf58b034b
commit ba87cc5c4a
1 changed files with 12 additions and 2 deletions

View File

@ -81,8 +81,18 @@
// We want our log messages to carry precise timestamps
args.unshift(this.icinga.utils.timeWithMs());
if (this.hasConsole() && this.hasLogLevel(level) && typeof console[level].apply === 'function') {
if (this.hasConsole() && this.hasLogLevel(level)) {
if (typeof console[level] !== 'undefined') {
if (typeof console[level].apply === 'function') {
console[level].apply(console, args);
} else {
args.unshift('[' + level + ']');
console[level](args.join(' '));
}
} else if ('undefined' !== typeof console.log) {
args.unshift('[' + level + ']');
console.log(args.join(' '));
}
}
return this;
},