Skip to content

Commit adaf301

Browse files
committed
fix: error logging
1 parent a8f9a29 commit adaf301

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/reporters/classic.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,18 @@ module.exports = function ClassicReporter(options) {
5656
write('\nLifting the server siege...');
5757
},
5858
record: function (item) {
59-
var failed = item.failure || item.statusCode >= 400;
59+
var failed = Boolean(item.failure || item.statusCode >= 400);
6060
requests.push(_.assign({failed: failed}, item));
6161
if (options.quiet) { return; }
6262

6363
if (item.failure) {
64-
write('[' + 'error'.yellow + '] ' + item.failure.message);
64+
write('[' + colors.yellow('error') + '] ' + item.failure.message);
6565
} else {
6666
var status = 'HTTP/' + item.httpVersion + ' ' + item.statusCode;
6767
var duration = padTo(item.totalDuration, 7, true) + padTo(' ms:', 10);
6868
var bytes = item.bytes + ' bytes ==> ';
6969
var url = item.method + ' ' + (options.longUrl ? item.url : item.path);
70-
var s = status + duration + bytes + url;
71-
write(getColorized(s, item.statusCode));
70+
write(getColorized(status + duration + bytes + url, item.statusCode));
7271
}
7372
},
7473
report: function (concurrencySnapshots) {

0 commit comments

Comments
 (0)