How to use the setDefaultLevel function from loglevel
Find comprehensive JavaScript loglevel.setDefaultLevel code examples handpicked from public code repositorys.
1 2 3 4 5 6 7 8 9
// setup log level const log = require('loglevel'); if (process.env.NODE_LOG_LEVEL) { log.setDefaultLevel(process.env.NODE_LOG_LEVEL); } else { log.setDefaultLevel('info'); }
8
1
8
+ 3 other calls in file
GitHub: medic/couch2pg
30 31 32 33 34 35 36 37 38
if (!couchdbUrl || !postgresqlUrl) { program.help(); } if (program.verbose) { log.setDefaultLevel('debug'); } else { log.setDefaultLevel('info'); }
3
10
15
+ 3 other calls in file
168 169 170 171 172 173 174 175 176
lightNode, blocksToKeep, } = conf; javascriptVMTimeout = conf.javascriptVMTimeout; // eslint-disable-line prefer-destructuring enableHashVerification = conf.enableHashVerification; // eslint-disable-line prefer-destructuring log.setDefaultLevel(conf.defaultLogLevel ? conf.defaultLogLevel : 'warn'); database = new Database(); await database.init(databaseURL, databaseName, lightNode, blocksToKeep);
7
8
0
90 91 92 93 94 95 96 97 98 99
prefix.apply(mlog.getLogger('critical'), { format (level, name, timestamp) { return chalk.red.bold(`[${timestamp}] ${level} ${name}:`) } }) mlog.setDefaultLevel('info') log.info(`${myModName}: setup.`) } exports.setup = setup
0
2
2
GitHub: Archive-42/Learning-Assets
465 466 467 468 469 470 471 472 473 474
.action( tryOrExit(async ({ args, options }) => { const { locale } = args; const { verbose } = options; if (verbose) { log.setDefaultLevel(log.levels.DEBUG); } for (const l of locale) { const { movedDocs,
3
1
0
33 34 35 36 37 38 39 40 41
} }, options ) log.setDefaultLevel('error') log.setLevel(options.logLevel) const bus = new EventBus(log)
0
1
0
loglevel.debug is the most popular function in loglevel (1470 examples)