diff options
author | Brian White <mscdex@mscdex.net> | 2020-03-14 14:55:44 +0300 |
---|---|---|
committer | Brian White <mscdex@mscdex.net> | 2020-05-31 00:24:43 +0300 |
commit | c24b74a7abec0848484671771d250cfd961f128e (patch) | |
tree | 1e4fec15ee4de3ab4bc483f759322389d71932ec /lib/internal/repl | |
parent | 3f32126fd554be32cb53a2458849697146145fda (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/repl')
-rw-r--r-- | lib/internal/repl/history.js | 4 | ||||
-rw-r--r-- | lib/internal/repl/utils.js | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/internal/repl/history.js b/lib/internal/repl/history.js index 6404e821b13..5188af94758 100644 --- a/lib/internal/repl/history.js +++ b/lib/internal/repl/history.js @@ -8,7 +8,9 @@ const { Interface } = require('readline'); const path = require('path'); const fs = require('fs'); const os = require('os'); -const debug = require('internal/util/debuglog').debuglog('repl'); +let debug = require('internal/util/debuglog').debuglog('repl', (fn) => { + debug = fn; +}); const { clearTimeout, setTimeout } = require('timers'); // XXX(chrisdickinson): The 15ms debounce value is somewhat arbitrary. diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index 160417491fe..9ce243a0bca 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -40,7 +40,9 @@ const { inspect, } = require('internal/util/inspect'); -const debug = require('internal/util/debuglog').debuglog('repl'); +let debug = require('internal/util/debuglog').debuglog('repl', (fn) => { + debug = fn; +}); const previewOptions = { colors: false, |