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 71b542a commit 16179b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,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 16179b0

Please sign in to comment.