From 0ae9f2ef01794c3100364c764e72309c6a87c37c 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 c6915e903e9d01..7eda063dde9966 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,