Skip to content

Commit 1f4f811

Browse files
mabaasittargos
authored andcommitted
http2: log debug only when in debug mode
PR-URL: #43626 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ricky Zhou <[email protected]>
1 parent 0783663 commit 1f4f811

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/http2/core.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ let debug = require('internal/util/debuglog').debuglog('http2', (fn) => {
190190
debug = fn;
191191
});
192192

193-
// TODO(addaleax): See if this can be made more efficient by figuring out
194-
// whether debugging is enabled before we perform any further steps. Currently,
195-
// this seems pretty fast, though.
196193
function debugStream(id, sessionType, message, ...args) {
194+
if (!debug.enabled) {
195+
return;
196+
}
197197
debug('Http2Stream %s [Http2Session %s]: ' + message,
198198
id, sessionName(sessionType), ...new SafeArrayIterator(args));
199199
}

0 commit comments

Comments
 (0)