Skip to content

Commit

Permalink
Merge pull request #2837 from JakeChampion/logs
Browse files Browse the repository at this point in the history
fix(config): Call debug log methods after setting the loglevel based upon config/cli-options
  • Loading branch information
dignifiedquire authored Nov 22, 2017
2 parents 6d353dc + a340dae commit e23c0d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,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)
Expand Down Expand Up @@ -397,7 +396,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 () {}
}
Expand Down Expand Up @@ -441,6 +439,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)
}

Expand Down

0 comments on commit e23c0d4

Please sign in to comment.