From 2ed5fcf64ea00ae82abde64630e17a12a01d7129 Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Sun, 22 Mar 2015 17:07:25 -0700 Subject: [PATCH] Add CLI flag for enabling debug logging --- lib/logger.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/logger.js b/lib/logger.js index e79b6b2..7ee376b 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -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;