Skip to content

Commit

Permalink
http2: fix debugStream method
Browse files Browse the repository at this point in the history
So it actually logs something when debug is activated.

PR-URL: #45129
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
  • Loading branch information
santigimeno authored and RafaelGSS committed Nov 10, 2022
1 parent 0a6ed6f commit 94b7f53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 94b7f53

Please sign in to comment.