http2: fix debugStream method

So it actually logs something when debug is activated.

PR-URL: https://github.com/nodejs/node/pull/45129
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Santiago Gimeno
2022-10-25 09:38:11 +02:00
committed by GitHub
parent c6c18a9a24
commit bb7650bb45

View File

@@ -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,