From a198b4d7ac8f6b39baf7c4bad42886ae5a0a7e3d Mon Sep 17 00:00:00 2001 From: moloko Date: Sat, 24 Jun 2017 21:05:30 +0100 Subject: [PATCH 1/2] amend _logToConsole so that it'll try and find a matching method of the console object to use --- src/core/js/logging.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/js/logging.js b/src/core/js/logging.js index e338703b7..11e1980df 100644 --- a/src/core/js/logging.js +++ b/src/core/js/logging.js @@ -97,8 +97,12 @@ define([ var log = [level.asUpperCase + ':']; data && log.push.apply(log, data); - console.log.apply(console, log); - + // is there a matching console method we can use e.g. console.error()? + if(console[level.asLowerCase]) { + console[level.asLowerCase].apply(console, log); + } else { + console.log.apply(console, log); + } } }); From 933e0075506a76c04bb800f2d66d9613ed6a5ed2 Mon Sep 17 00:00:00 2001 From: moloko Date: Sat, 24 Jun 2017 21:07:09 +0100 Subject: [PATCH 2/2] remove trailing comma --- src/core/js/logging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/js/logging.js b/src/core/js/logging.js index 11e1980df..016142e9c 100644 --- a/src/core/js/logging.js +++ b/src/core/js/logging.js @@ -8,7 +8,7 @@ define([ _config: { _isEnabled: true, _level: LOG_LEVEL.INFO.asLowerCase, // Default log level - _console: true, // Log to console + _console: true // Log to console }, initialize: function() {