From a340dae52cd1955ff6d6a6a3dd6799cb23bd8e32 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Wed, 22 Nov 2017 15:20:54 +0000 Subject: [PATCH] fix(config): Call debug log methods after setting the loglevel based upon config/cli-options. --- lib/config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/config.js b/lib/config.js index 32c67bb8e..c33690e96 100644 --- a/lib/config.js +++ b/lib/config.js @@ -357,7 +357,6 @@ var CONFIG_SYNTAX_HELP = ' module.exports = function(config) {\n' + var parseConfig = function (configFilePath, cliOptions) { var configModule if (configFilePath) { - log.debug('Loading config %s', configFilePath) try { configModule = require(configFilePath) @@ -389,7 +388,6 @@ var parseConfig = function (configFilePath, cliOptions) { return process.exit(1) } } else { - log.debug('No config file specified.') // if no config file path is passed, we define a dummy config module. configModule = function () {} } @@ -433,6 +431,12 @@ var parseConfig = function (configFilePath, cliOptions) { // configure the logger as soon as we can logger.setup(config.logLevel, config.colors, config.loggers) + if (configFilePath) { + log.debug('Loading config %s', configFilePath) + } else { + log.debug('No config file specified.') + } + return normalizeConfig(config, configFilePath) }