configurable debug level by env variable DEBUG, e.g.
authorWolfram Schneider <wosch@indexdata.dk>
Mon, 3 Feb 2014 12:17:16 +0000 (13:17 +0100)
committerWolfram Schneider <wosch@indexdata.dk>
Mon, 3 Feb 2014 12:17:16 +0000 (13:17 +0100)
$ DEBUG=2 make phantomjs

test/phantom/evaluate.js

index 52e044d..27a2d71 100644 (file)
@@ -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);