From: Wolfram Schneider Date: Mon, 3 Feb 2014 12:17:16 +0000 (+0100) Subject: configurable debug level by env variable DEBUG, e.g. X-Git-Tag: 1.0.0~1537^2 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=b36bc57a37bde111fb57e3b1ef184b5ec28e1d93 configurable debug level by env variable DEBUG, e.g. $ DEBUG=2 make phantomjs --- diff --git a/test/phantom/evaluate.js b/test/phantom/evaluate.js index 52e044d..27a2d71 100644 --- a/test/phantom/evaluate.js +++ b/test/phantom/evaluate.js @@ -26,7 +26,10 @@ page.viewportSize = { // 0: silent, 1: some infos, 2: display console.log() output var debug = 2; - +if (system.env['DEBUG'] != 'undefined' && parseInt(system.env['DEBUG']) != NaN) { + debug = system.env['DEBUG']; + if (debug > 0) console.log("reset debug level to: " + debug); +} /************************/ @@ -103,6 +106,7 @@ page.open(url, function (status) { function (result) { if (debug < 1) return; + console.log(""); console.log("MKWS tests are successfully done in " + result.time / 1000 + " seconds. Hooray!"); console.log("jasmine duration: " + result.duration); console.log("jasmine passing: " + result.passing);