Commit 913be452 913be452b1403b50e211f9d661b68e562fd702e7 by Nicolas Perriault

added colored log output

1 parent 80fa8e5c
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
60 this.currentHTTPStatus = 200; 60 this.currentHTTPStatus = 200;
61 this.loadInProgress = false; 61 this.loadInProgress = false;
62 this.logLevels = ["debug", "info", "warning", "error"]; 62 this.logLevels = ["debug", "info", "warning", "error"];
63 this.logStyles = {
64 debug: 'INFO',
65 info: 'PARAMETER',
66 warning: 'COMMENT',
67 error: 'ERROR'
68 };
63 this.options = mergeObjects(this.defaults, options); 69 this.options = mergeObjects(this.defaults, options);
64 this.page = null; 70 this.page = null;
65 this.requestUrl = 'about:blank'; 71 this.requestUrl = 'about:blank';
...@@ -442,7 +448,8 @@ ...@@ -442,7 +448,8 @@
442 return this; // skip logging 448 return this; // skip logging
443 } 449 }
444 if (this.options.verbose) { 450 if (this.options.verbose) {
445 this.echo('[' + level + '] [' + space + '] ' + message); // direct output 451 var levelStr = this.colorizer.colorize('[' + level + ']', this.logStyles[level]);
452 this.echo(levelStr + ' [' + space + '] ' + message); // direct output
446 } 453 }
447 this.result.log.push({ 454 this.result.log.push({
448 level: level, 455 level: level,
......