-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: change current exported function "log"
BREAKING CHANGE: the exports on this package have changed. The current functionality has moved to a `log` function in the exports.
- Loading branch information
Showing
3 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
// 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) | ||
const log = { | ||
LEVELS: [ | ||
'notice', | ||
'error', | ||
'warn', | ||
'info', | ||
'verbose', | ||
'http', | ||
'silly', | ||
'pause', | ||
'resume', | ||
], | ||
} | ||
for (const level of log.LEVELS) { | ||
log[level] = (...args) => process.emit('log', level, ...args) | ||
} | ||
|
||
logger.LEVELS = LEVELS | ||
|
||
module.exports = logger | ||
module.exports = { log } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters