Skip to content

Commit

Permalink
fix(init): fix logger configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Jan 27, 2013
1 parent 5dd63ad commit 557922d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var glob = require('glob');
var helper = require('./helper');
var launcher = require('./launcher');
var logger = require('./logger');
var constant = require('./constants');

var log = logger.create('init');

Expand Down Expand Up @@ -287,16 +288,20 @@ var getReplacementsFromAnswers = function(answers, basePath) {


exports.init = function(config) {
var useColors = true;
var logLevel = constant.LOG_INFO;

if (helper.isDefined(config.colors)) {
colors = config.colors ? COLORS_ON : COLORS_OFF;
logger.useColors(config.colors);
useColors = config.colors;
}

if (helper.isDefined(config.logLevel)) {
logger.setLevel(config.logLevel);
logLevel = config.logLevel;
}

logger.setup(useColors, logLevel);


// need to be registered before creating readlineInterface
process.stdin.on('keypress', function(s, key) {
Expand Down

0 comments on commit 557922d

Please sign in to comment.