mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 10:27:12 +00:00

PR-URL: https://github.com/nodejs/node/pull/38475 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
23 lines
352 B
JavaScript
23 lines
352 B
JavaScript
// emits 'log' events on the process
|
|
const LEVELS = [
|
|
'notice',
|
|
'error',
|
|
'warn',
|
|
'info',
|
|
'verbose',
|
|
'http',
|
|
'silly',
|
|
'pause',
|
|
'resume',
|
|
]
|
|
|
|
const log = level => (...args) => process.emit('log', level, ...args)
|
|
|
|
const logger = {}
|
|
for (const level of LEVELS)
|
|
logger[level] = log(level)
|
|
|
|
logger.LEVELS = LEVELS
|
|
|
|
module.exports = logger
|