+ -l option to set the log level

This commit is contained in:
nicobo 2021-06-11 00:25:28 +02:00
parent 60c096a39b
commit f32c31f46a
No known key found for this signature in database
GPG key ID: 2581E71C5FA5285F

View file

@ -124,11 +124,23 @@ const argv = yargs
type: 'array',
demandOption: true
})
.option('l', {
alias: ['log-level'],
describe: 'Specifies the logging level',
choices: ['error','warn','info','http','verbose','debug','silly'],
type: 'string'
})
// --config : configuration as a whole .json file
.config()
.help()
.alias('help', 'h')
.argv;
// Reflects log level option
if ( argv.l !== undefined ) {
log.level = argv.l;
}
log.debug("argv: %o", argv);
// Instanciates the handlers for each scenario