Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2020-03-14 14:55:44 +0300
committerBrian White <mscdex@mscdex.net>2020-05-31 00:24:43 +0300
commitc24b74a7abec0848484671771d250cfd961f128e (patch)
tree1e4fec15ee4de3ab4bc483f759322389d71932ec /lib/internal/stream_base_commons.js
parent3f32126fd554be32cb53a2458849697146145fda (diff)
lib: improve debuglog() performance
PR-URL: https://github.com/nodejs/node/pull/32260 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/stream_base_commons.js')
-rw-r--r--lib/internal/stream_base_commons.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js
index 31f1ba67f13..569a1419b5f 100644
--- a/lib/internal/stream_base_commons.js
+++ b/lib/internal/stream_base_commons.js
@@ -37,7 +37,9 @@ const kAfterAsyncWrite = Symbol('kAfterAsyncWrite');
const kHandle = Symbol('kHandle');
const kSession = Symbol('kSession');
-const debug = require('internal/util/debuglog').debuglog('stream');
+let debug = require('internal/util/debuglog').debuglog('stream', (fn) => {
+ debug = fn;
+});
const kBuffer = Symbol('kBuffer');
const kBufferGen = Symbol('kBufferGen');
const kBufferCb = Symbol('kBufferCb');