From 557922d71941e0929f9cdc0d3794424a1f27b311 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Sat, 26 Jan 2013 02:05:35 -0800 Subject: [PATCH] fix(init): fix logger configuration --- lib/init.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/init.js b/lib/init.js index 9033fdc0f..855695cad 100755 --- a/lib/init.js +++ b/lib/init.js @@ -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'); @@ -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) {