Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
349 bytes
|
Line | |
---|
1 | // default logger.
|
---|
2 | // emits 'log' events on the process
|
---|
3 | const LEVELS = [
|
---|
4 | 'notice',
|
---|
5 | 'error',
|
---|
6 | 'warn',
|
---|
7 | 'info',
|
---|
8 | 'verbose',
|
---|
9 | 'http',
|
---|
10 | 'silly',
|
---|
11 | 'pause',
|
---|
12 | 'resume'
|
---|
13 | ]
|
---|
14 |
|
---|
15 | const log = level => (...args) => process.emit('log', level, ...args)
|
---|
16 |
|
---|
17 | const logger = {}
|
---|
18 | for (const level of LEVELS) {
|
---|
19 | logger[level] = log(level)
|
---|
20 | }
|
---|
21 | module.exports = logger
|
---|
Note:
See
TracBrowser
for help on using the repository browser.