From 9983f36e14678f02826e7c3146314fd4ecfe44ee Mon Sep 17 00:00:00 2001 From: SangYong Park Date: Wed, 14 Mar 2018 17:56:05 +0900 Subject: [PATCH] Fix DEBUG environment variable issue After enable debug module's log, web inspector is created. Because, debug module is set DEBUG environment variable when enable() api is called. so reset environment variable after log enabling. Change-Id: Iac559ef57da9625dbcda4af3157f7fc0212721f5 Signed-off-by: SangYong Park --- wrt/src/main.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wrt/src/main.js b/wrt/src/main.js index 6059b26..e1d47f0 100644 --- a/wrt/src/main.js +++ b/wrt/src/main.js @@ -10,7 +10,15 @@ const _string = require('underscore.string'); const {app} = require('electron'); process.env.WRT_HOME = process.env.WRT_HOME || __dirname; -require('debug').enable('*'); // FIXME : temporary fix for log +// FIXME : temporary fix for log +{ + let originalDebug = process.env.DEBUG; + require('debug').enable('*'); + if (originalDebug === undefined) + delete process.env.DEBUG; + else + process.env.DEBUG = originalDebug; +} path_debug('__dirname : ' + __dirname); path_debug('process.env.WRT_HOME : ' + process.env.WRT_HOME); -- 2.7.4