optimize: 请求返回日志,添加响应码。

pull/384/head
王良 4 weeks ago
parent 909228ec37
commit a66af327c1

@ -153,9 +153,9 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e
proxyReq = (rOptions.protocol === 'https:' ? https : http).request(rOptions, (proxyRes) => {
const cost = new Date() - start
if (rOptions.protocol === 'https:') {
log.info(`代理请求返回: ${url}, cost: ${cost} ms`)
log.info(`代理请求返回: ${proxyRes.statusCode}${url}, cost: ${cost} ms`)
} else {
log.info(`请求返回: ${url}, cost: ${cost} ms`)
log.info(`请求返回: ${proxyRes.statusCode}${url}, cost: ${cost} ms`)
}
// console.log('request:', proxyReq, proxyReq.socket)

Loading…
Cancel
Save