Skip to content

Commit 15af519

Browse files
toshi1127targos
authored andcommitted
http2: reduce usage of require('util')
PR-URL: #26784 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
1 parent fbe6d30 commit 15af519

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/http2/core.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const net = require('net');
1818
const { Duplex } = require('stream');
1919
const tls = require('tls');
2020
const { URL } = require('url');
21-
const util = require('util');
2221

2322
const { kIncomingMessage } = require('_http_common');
2423
const { kServerResponse } = require('_http_server');
@@ -120,6 +119,7 @@ const {
120119
validateTimerDuration
121120
} = require('internal/timers');
122121
const { isArrayBufferView } = require('internal/util/types');
122+
const { format } = require('internal/util/inspect');
123123

124124
const hasOwnProperty = Object.prototype.hasOwnProperty;
125125

@@ -134,7 +134,7 @@ const { UV_EOF } = internalBinding('uv');
134134

135135
const { StreamPipe } = internalBinding('stream_pipe');
136136
const { _connectionListener: httpConnectionListener } = http;
137-
const debug = util.debuglog('http2');
137+
const debug = require('internal/util/debuglog').debuglog('http2');
138138

139139
const kMaxFrameSize = (2 ** 24) - 1;
140140
const kMaxInt = (2 ** 32) - 1;
@@ -1087,7 +1087,7 @@ class Http2Session extends EventEmitter {
10871087
localSettings: this.localSettings,
10881088
remoteSettings: this.remoteSettings
10891089
};
1090-
return `Http2Session ${util.format(obj)}`;
1090+
return `Http2Session ${format(obj)}`;
10911091
}
10921092

10931093
// The socket owned by this session
@@ -1663,7 +1663,7 @@ class Http2Stream extends Duplex {
16631663
readableState: this._readableState,
16641664
writableState: this._writableState
16651665
};
1666-
return `Http2Stream ${util.format(obj)}`;
1666+
return `Http2Stream ${format(obj)}`;
16671667
}
16681668

16691669
get bufferSize() {

0 commit comments

Comments
 (0)