Skip to content

Commit 67053ce

Browse files
日志优化。
1 parent 08dd119 commit 67053ce

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/mitmproxy/src/lib/proxy/compatible/compatible.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const config = _loadFromFile(defaultConfig)
3232

3333
function _getConnectConfig (hostname, port) {
3434
const connectConfig = config.connect[`${hostname}:${port}`]
35-
log.info(`getConnectConfig: ${hostname}:${port}, ${jsonApi.stringify2(connectConfig)}`)
35+
log.debug(`getConnectConfig: ${hostname}:${port}, ${jsonApi.stringify2(connectConfig)}`)
3636
return connectConfig
3737
}
3838
function _getRequestConfig (hostname, port) {
3939
const requestConfig = config.request[`${hostname}:${port}`]
40-
log.info(`getRequestConfig: ${hostname}:${port}, ${jsonApi.stringify2(requestConfig)}`)
40+
log.debug(`getRequestConfig: ${hostname}:${port}, ${jsonApi.stringify2(requestConfig)}`)
4141
return requestConfig
4242
}
4343

packages/mitmproxy/src/lib/proxy/tls/CertAndKeyContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = class CertAndKeyContainer {
1717
return 1
1818
},
1919
dispose: (_evictCertPromiseObj, evictKey) => {
20-
log.error(`旧证书缓存被移除:${evictKey}`)
20+
log.info(`旧证书缓存被移除:${evictKey}`)
2121
},
2222
})
2323
this.caCert = caCert
@@ -33,7 +33,7 @@ module.exports = class CertAndKeyContainer {
3333
// 获取缓存
3434
const cached = this.cache.get(dnsName)
3535
if (cached) {
36-
log.info(`Load fakeCertPromise from cache, hostname: ${hostname}:${port}, certPromiseObj: {"mappingHostNames":${JSON.stringify(cached.mappingHostNames)}}`)
36+
log.debug(`Load fakeCertPromise from cache, hostname: ${hostname}:${port}, certPromiseObj: {"mappingHostNames":${JSON.stringify(cached.mappingHostNames)}}`)
3737
return cached.promise
3838
}
3939

packages/mitmproxy/src/lib/proxy/tls/FakeServersCenter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ module.exports = class FakeServersCenter {
8383
}
8484
}
8585

86-
log.info(`getServerPromise, hostname: ${hostname}:${port}, ssl: ${ssl}, protocol: ${ssl ? 'https' : 'http'}`)
87-
8886
const dnsName = getDnsName(hostname)
8987
const cacheKey = `${dnsName}:${port}:${ssl}`
9088

9189
const cachedServerObj = this.cache.get(cacheKey)
9290
if (cachedServerObj) {
93-
log.info(`Load fakeServerPromise from cache, hostname: ${hostname}:${port}, ssl: ${ssl}, serverPromiseObj: {"ssl":${cachedServerObj.ssl},"port":${cachedServerObj.port},"mappingHostNames":${JSON.stringify(cachedServerObj.mappingHostNames)}}`)
91+
log.debug(`Load fakeServerPromise from cache, hostname: ${hostname}:${port}, ssl: ${ssl}, serverPromiseObj: {"ssl":${cachedServerObj.ssl},"port":${cachedServerObj.port},"mappingHostNames":${JSON.stringify(cachedServerObj.mappingHostNames)}}`)
9492
return cachedServerObj.promise
9593
}
9694

95+
log.info(`getServerPromise, hostname: ${hostname}:${port}, ssl: ${ssl}, protocol: ${ssl ? 'https' : 'http'}`)
96+
9797
const mappingHostNames = [dnsName]
9898
if (dnsName.startsWith('*.')) {
9999
mappingHostNames.push(dnsName.replace('*.', ''))

0 commit comments

Comments
 (0)