From ebb55720d5fba368157caa0eedbd66796bb34704 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 31 Mar 2020 13:30:44 -0700 Subject: [PATCH] test: replace console.error() with debuglog calls Somehow thought I did this in 8905be2ceea9abead85a5018c09645a3650d7495 but clearly did not. PR-URL: https://github.com/nodejs/node/pull/32588 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Yongsheng Zhang --- test/parallel/test-http-information-processing.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http-information-processing.js b/test/parallel/test-http-information-processing.js index c30544ef68ca81..b9e5fea339ad0f 100644 --- a/test/parallel/test-http-information-processing.js +++ b/test/parallel/test-http-information-processing.js @@ -2,16 +2,17 @@ require('../common'); const assert = require('assert'); const http = require('http'); +const debug = require('util').debuglog('test'); const testResBody = 'other stuff!\n'; const kMessageCount = 2; const server = http.createServer((req, res) => { for (let i = 0; i < kMessageCount; i++) { - console.error(`Server sending informational message #${i}...`); + debug(`Server sending informational message #${i}...`); res.writeProcessing(); } - console.error('Server sending full response...'); + debug('Server sending full response...'); res.writeHead(200, { 'Content-Type': 'text/plain', 'ABCD': '1' @@ -25,7 +26,7 @@ server.listen(0, function() { path: '/world' }); req.end(); - console.error('Client sending request...'); + debug('Client sending request...'); let body = ''; let infoCount = 0; @@ -40,7 +41,7 @@ server.listen(0, function() { res.setEncoding('utf8'); res.on('data', function(chunk) { body += chunk; }); res.on('end', function() { - console.error('Got full response.'); + debug('Got full response.'); assert.strictEqual(body, testResBody); assert.ok('abcd' in res.headers); server.close();