From 94b7f5338c60978783db256bd98ca5a11dd845ef Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Tue, 25 Oct 2022 09:38:11 +0200 Subject: [PATCH] http2: fix debugStream method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So it actually logs something when debug is activated. PR-URL: https://github.com/nodejs/node/pull/45129 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Juan José Arboleda --- lib/internal/http2/core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 456ea27cfebf79..3ca6504d934dcc 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -189,9 +189,10 @@ const { _connectionListener: httpConnectionListener } = http; let debug = require('internal/util/debuglog').debuglog('http2', (fn) => { debug = fn; }); +const debugEnabled = debug.enabled; function debugStream(id, sessionType, message, ...args) { - if (!debug.enabled) { + if (!debugEnabled) { return; } debug('Http2Stream %s [Http2Session %s]: ' + message,