Skip to content

Commit

Permalink
fix console null reference in logger (in webworkers) (#2095)
Browse files Browse the repository at this point in the history
Fix null reference in logger when console is not available
  • Loading branch information
mad-gooze authored and johnBartos committed Jan 30, 2019
1 parent a0c28c5 commit 5b6d7fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function exportLoggerFunctions (debugConfig, ...functions) {
}

export var enableLogs = function (debugConfig) {
if (debugConfig === true || typeof debugConfig === 'object') {
// check that console is available
if ((global.console && debugConfig === true) || typeof debugConfig === 'object') {
exportLoggerFunctions(debugConfig,
// Remove out from list here to hard-disable a log-level
// 'trace',
Expand Down

0 comments on commit 5b6d7fe

Please sign in to comment.