Skip to content

Commit

Permalink
http2: log debug only when in debug mode
Browse files Browse the repository at this point in the history
PR-URL: #43626
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
  • Loading branch information
mabaasit authored Jul 8, 2022
1 parent 680dd7c commit f3a92a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ let debug = require('internal/util/debuglog').debuglog('http2', (fn) => {
debug = fn;
});

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

0 comments on commit f3a92a0

Please sign in to comment.