You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Used to tell the consumer that it is ok to print messages again.
40
45
*`log.LEVELS` an array of strings of all log method names
41
46
42
47
## Examples
43
48
44
-
Every `log` method calls `process.emit('log', level, ...otherArgs)` internally.
45
-
So in order to consume those events you need to do `process.on('log', fn)`.
49
+
Every `log` method calls `process.emit('log', level, ...otherArgs)` internally. So in order to consume those events you need to do `process.on('log', fn)`.
46
50
47
51
### Colorize based on level
48
52
49
-
Here's an example of how to consume `proc-log` events and colorize them
50
-
based on level:
53
+
Here's an example of how to consume `proc-log` log events and colorize them based on level:
`pause` and `resume` are included so you have the ability to tell your consumer
67
-
that you want to pause or resume your display of logs. In the npm CLI we use
68
-
this to buffer all logs on init until we know the correct loglevel to display.
69
-
But we also setup a second handler that writes everything to a file even if
70
-
paused.
69
+
`log.pause` and `log.resume` are included so you have the ability to tell your consumer that you want to pause or resume your display of logs. In the npm CLI we use this to buffer all logs on init until we know the correct loglevel to display. But we also setup a second handler that writes everything to a file even if paused.
71
70
72
71
```js
73
72
let paused =true
74
73
constbuffer= []
75
74
76
-
// this handler will buffer and replay logs only
77
-
// after `procLog.resume()` is called
75
+
// this handler will buffer and replay logs only after `procLog.resume()` is called
0 commit comments