diff --git a/lib/log.js b/lib/log.js index 6841719aba..36fa2487f5 100644 --- a/lib/log.js +++ b/lib/log.js @@ -1,12 +1,11 @@ 'use strict' -const procLog = require('proc-log') +const { log } = require('proc-log') const { format } = require('util') // helper to emit log messages with a predefined prefix -const logLevels = Object.keys(procLog).filter((k) => typeof procLog[k] === 'function') -const withPrefix = (prefix) => logLevels.reduce((acc, level) => { - acc[level] = (...args) => procLog[level](prefix, ...args) +const withPrefix = (prefix) => log.LEVELS.reduce((acc, level) => { + acc[level] = (...args) => log[level](prefix, ...args) return acc }, {}) @@ -78,7 +77,7 @@ class Logger { this.#levels = new Map(this.#levels.map((level, index) => [level.id, { ...level, index }])) this.level = 'info' this.stream = stream - procLog.pause() + log.pause() } get stream () { @@ -165,5 +164,5 @@ module.exports = { logger: new Logger(NULL_LOGGER ? null : process.stderr), stdout: NULL_LOGGER ? () => {} : (...args) => console.log(...args), withPrefix, - ...procLog + ...log } diff --git a/package.json b/package.json index 6a24a1aaf0..e9402d7923 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "graceful-fs": "^4.2.6", "make-fetch-happen": "^13.0.0", "nopt": "^7.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.1.0", "semver": "^7.3.5", "tar": "^6.2.1", "which": "^4.0.0"