From ba87cc5c4a667a2d7f6244cae1eda97ca1db0799 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 6 Jun 2014 05:23:57 +0000 Subject: [PATCH] IE8/JS: some more console logging fixes refs #6417 --- public/js/icinga/logger.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/logger.js b/public/js/icinga/logger.js index 6cd9ad047..706f57adc 100644 --- a/public/js/icinga/logger.js +++ b/public/js/icinga/logger.js @@ -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') { - console[level].apply(console, args); + 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; },