How to use the level function from npmlog

Find comprehensive JavaScript npmlog.level code examples handpicked from public code repositorys.

182
183
184
185
186
187
188
189
190
191
// level -+   |      |                         |
//        v   v      v                         v
    log.info('fyi', 'I have a kitty cat: %j', myKittyCat)
```

## log.level

* {String}

The level to display logs at.  Any logs at or above this level will be
fork icon19
star icon22
watch icon13

+ 9 other calls in file

180
181
182
183
184
185
186
187
188
189
// Set a logging level
level(level) {
  if (level) {
    npmlog.level = level;
  } else {
    return npmlog.level;
  }
},
// Enable or disable ALL logging.
disable() {
fork icon56
star icon115
watch icon30

+ 5 other calls in file

9
10
11
12
13
14
15
16
17
18
log.addLevel('error', 5000, { fg: 'brightRed' }, 'ERR!')

var defaults = {
  prefixStyle: log.prefixStyle
, headingStyle: log.headingStyle
, loglevel: log.level
, stream: process.stderr
, timestamp: true
, heading: ''
}
fork icon0
star icon0
watch icon2