How to use the levels function from npmlog
Find comprehensive JavaScript npmlog.levels code examples handpicked from public code repositorys.
23 24 25 26 27 28 29 30 31 32
log.error('', 'cb() never called!') } if (wroteLogFile) { // just a line break if (log.levels[log.level] <= log.levels.error) console.error('') log.error( '', [
11
113
6
+ 7 other calls in file
28 29 30 31 32 33 34 35 36 37
``` __levels:__ ```js > log.levels { silly: -Infinity, verbose: 1000, info: 2000, http: 3000,
7
40
4
+ 3 other calls in file
125 126 127 128 129 130 131 132 133 134
npmlog.level = lvl; header('header', logger.NO_CLIENT_ID, {title: 'Log'}); var debug = process.env.PN_TRACE_FRM + ',' || ''; if (npmlog.levels[npmlog.level] <= npmlog.levels.debug) { logger.log('debug', logger.NO_CLIENT_ID, 'Setting basic amqp10 debug'); process.env.DEBUG = debug + 'amqp10:*,-amqp10:session,-amqp10:framing,-amqp10:sasl'; if (npmlog.levels[npmlog.level] <= npmlog.levels.detail) {
9
18
3
+ 3 other calls in file
69 70 71 72 73 74 75 76 77
process.stdout.write = wrapWrite(process.stdout.write); process.stderr.write = wrapWrite(process.stderr.write); } // Add custom log levels log.addLevel('stat', log.levels.warn - 100, { fg: 'green', bg: 'black' }); // Print whole objects and not 2 levels deep log.log = wrap(log.log, npmLog);
48
0
2
+ 3 other calls in file
16 17 18 19 20 21 22 23 24 25 26 27
const auditError = require('./audit-error.js') // TODO: output JSON if flatOptions.json is true const reifyOutput = (npm, arb) => { // don't print any info in --silent mode if (log.levels[log.level] > log.levels.error) return const { diff, actualTree } = arb
0
0
0
npmlog.verbose is the most popular function in npmlog (7425 examples)