Add CLI flag for enabling debug logging

This commit is contained in:
Andrew Stewart 2015-03-22 17:07:25 -07:00
parent 93dcf18cb5
commit 2ed5fcf64e
1 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,11 @@ var Logger = module.exports = {
var logger = Config.logging.logger,
level = Config.logging.level || "info";
// --debug CLI flag overrides any other option
if (_.includes(process.argv, "--debug")) {
level = "debug";
}
logger = (logger == null) ? BasicLogger : logger;
this.logger = logger || NullLogger;