diff --git a/lib/logger.js b/lib/logger.js index a63d1c98a..9a5652a7f 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -3,7 +3,7 @@ const { isBare, isWindows } = require('which-runtime') const hrtime = isBare ? require('bare-hrtime') : process.hrtime class Logger { - constructor ({ labels, fields = '', stacks = false, level = 1, pretty = false } = {}) { + constructor ({ labels, fields = '', stacks = false, level, pretty = false } = {}) { fields = this._parseFields(fields) this._labels = new Set(this._parseLabels(labels)) this._labels.add('internal') @@ -93,7 +93,7 @@ class Logger { } _parseLevel (level) { - if (typeof level !== 'string') return level + if (typeof level === 'number') return level level = level.toUpperCase() if (level === 'OFF' || level === '0') return 0 if (level === 'ERR' || level === 'ERROR' || level === '1') return 1