Skip to content

Commit

Permalink
http2: reduce usage of require('util')
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
toshi1127 authored and targos committed Mar 27, 2019
1 parent fbe6d30 commit 15af519
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const net = require('net');
const { Duplex } = require('stream');
const tls = require('tls');
const { URL } = require('url');
const util = require('util');

const { kIncomingMessage } = require('_http_common');
const { kServerResponse } = require('_http_server');
Expand Down Expand Up @@ -120,6 +119,7 @@ const {
validateTimerDuration
} = require('internal/timers');
const { isArrayBufferView } = require('internal/util/types');
const { format } = require('internal/util/inspect');

const hasOwnProperty = Object.prototype.hasOwnProperty;

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

const { StreamPipe } = internalBinding('stream_pipe');
const { _connectionListener: httpConnectionListener } = http;
const debug = util.debuglog('http2');
const debug = require('internal/util/debuglog').debuglog('http2');

const kMaxFrameSize = (2 ** 24) - 1;
const kMaxInt = (2 ** 32) - 1;
Expand Down Expand Up @@ -1087,7 +1087,7 @@ class Http2Session extends EventEmitter {
localSettings: this.localSettings,
remoteSettings: this.remoteSettings
};
return `Http2Session ${util.format(obj)}`;
return `Http2Session ${format(obj)}`;
}

// The socket owned by this session
Expand Down Expand Up @@ -1663,7 +1663,7 @@ class Http2Stream extends Duplex {
readableState: this._readableState,
writableState: this._writableState
};
return `Http2Stream ${util.format(obj)}`;
return `Http2Stream ${format(obj)}`;
}

get bufferSize() {
Expand Down

0 comments on commit 15af519

Please sign in to comment.