From 3ea5eadbf06a63b5a8fd10ddead6fd9e37f9740e Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 20 Nov 2014 16:09:01 +0000 Subject: [PATCH] Set the logging level _after_ the application has had a chance to set mkws_config. --- src/mkws-core.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 2b25807..176e6d7 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -111,8 +111,7 @@ mkws.stringToLevel = function(s) { mkws.logger = JL('mkws'); var consoleAppender = JL.createConsoleAppender('consoleAppender'); -mkws.logger.setOptions({ "appenders": [consoleAppender], - "level": mkws.stringToLevel(mkws.log_level) }); +mkws.logger.setOptions({ "appenders": [consoleAppender] }); function _log(fn, string) { @@ -178,7 +177,10 @@ mkws.promotionFunction = function(name) { mkws.setMkwsConfig = function(overrides) { // Set global log_level flag early so that _log() works var tmp = overrides.log_level; - if (typeof(tmp) !== 'undefined') mkws.log_level = tmp; + if (typeof(tmp) !== 'undefined') { + console.log("setting level to '" + tmp + "'"); + mkws.logger.setOptions({ "level": mkws.stringToLevel(tmp) }); + } var config_default = { use_service_proxy: true, -- 1.7.10.4