Skip to content

Commit

Permalink
fix(config): apply CLI logger options as soon as we can
Browse files Browse the repository at this point in the history
We use logging even before parsing the config file - for instance to show the path of the config file that is actually being loaded. At that time, we can't configure the logger based on the config file, but we can already apply the command line arguments.
  • Loading branch information
vojtajina committed Nov 30, 2013
1 parent 1370981 commit 6a02056
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/server.js
Expand Up @@ -171,8 +171,9 @@ var createSocketIoServer = function(webServer, executor, config) {


exports.start = function(cliOptions, done) {
// apply the default logger config as soon as we can
logger.setup(constant.LOG_INFO, true, [constant.CONSOLE_APPENDER]);
// apply the default logger config (and config from CLI) as soon as we can
logger.setup(cliOptions.logLevel || constant.LOG_INFO,
helper.isDefined(cliOptions.colors) ? cliOptions.colors : true, [constant.CONSOLE_APPENDER]);

var config = cfg.parseConfig(cliOptions.configFile, cliOptions);
var modules = [{
Expand Down

0 comments on commit 6a02056

Please sign in to comment.