Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Sep 13, 2024
1 parent b5e7c93 commit 34833de
Showing 1 changed file with 105 additions and 105 deletions.
210 changes: 105 additions & 105 deletions lib/core/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,57 +36,57 @@ function trackClientEvents (debugLog = undiciDebugLog) {

isTrackingClientEvents = true

diagnosticsChannel.subscribe('undici:client:beforeConnect',
diagnosticsChannel.subscribe('undici:client:beforeConnect',
evt => {
const {
connectParams: { version, protocol, port, host }
} = evt
debugLog(
'connecting to %s%s using %s%s',
host,
port ? `:${port}` : '',
protocol,
version
)
})

diagnosticsChannel.subscribe('undici:client:connected',
const {
connectParams: { version, protocol, port, host }
} = evt
debugLog(
'connecting to %s%s using %s%s',
host,
port ? `:${port}` : '',
protocol,
version
)
})

diagnosticsChannel.subscribe('undici:client:connected',
evt => {
const {
connectParams: { version, protocol, port, host }
} = evt
debugLog(
'connected to %s%s using %s%s',
host,
port ? `:${port}` : '',
protocol,
version
)
})

diagnosticsChannel.subscribe('undici:client:connectError',
const {
connectParams: { version, protocol, port, host }
} = evt
debugLog(
'connected to %s%s using %s%s',
host,
port ? `:${port}` : '',
protocol,
version
)
})

diagnosticsChannel.subscribe('undici:client:connectError',
evt => {
const {
connectParams: { version, protocol, port, host },
error
} = evt
debugLog(
'connection to %s%s using %s%s errored - %s',
host,
port ? `:${port}` : '',
protocol,
version,
error.message
)
})

diagnosticsChannel.subscribe('undici:client:sendHeaders',
const {
connectParams: { version, protocol, port, host },
error
} = evt
debugLog(
'connection to %s%s using %s%s errored - %s',
host,
port ? `:${port}` : '',
protocol,
version,
error.message
)
})

diagnosticsChannel.subscribe('undici:client:sendHeaders',
evt => {
const {
request: { method, path, origin }
} = evt
debugLog('sending request to %s %s/%s', method, origin, path)
})
const {
request: { method, path, origin }
} = evt
debugLog('sending request to %s %s/%s', method, origin, path)
})
}

let isTrackingRequestEvents = false
Expand All @@ -98,43 +98,43 @@ function trackRequestEvents (debugLog = undiciDebugLog) {

isTrackingRequestEvents = true

diagnosticsChannel.subscribe('undici:request:headers',
diagnosticsChannel.subscribe('undici:request:headers',
evt => {
const {
request: { method, path, origin },
response: { statusCode }
} = evt
debugLog(
'received response to %s %s/%s - HTTP %d',
method,
origin,
path,
statusCode
)
})

diagnosticsChannel.subscribe('undici:request:trailers',
const {
request: { method, path, origin },
response: { statusCode }
} = evt
debugLog(
'received response to %s %s/%s - HTTP %d',
method,
origin,
path,
statusCode
)
})

diagnosticsChannel.subscribe('undici:request:trailers',
evt => {
const {
request: { method, path, origin }
} = evt
debugLog('trailers received from %s %s/%s', method, origin, path)
})
const {
request: { method, path, origin }
} = evt
debugLog('trailers received from %s %s/%s', method, origin, path)
})

diagnosticsChannel.subscribe('undici:request:error',
diagnosticsChannel.subscribe('undici:request:error',
evt => {
const {
request: { method, path, origin },
error
} = evt
debugLog(
'request to %s %s/%s errored - %s',
method,
origin,
path,
error.message
)
})
const {
request: { method, path, origin },
error
} = evt
debugLog(
'request to %s %s/%s errored - %s',
method,
origin,
path,
error.message
)
})
}

let isTrackingWebSocketEvents = false
Expand All @@ -146,39 +146,39 @@ function trackWebSocketEvents (debugLog = websocketDebuglog) {

isTrackingWebSocketEvents = true

diagnosticsChannel.subscribe('undici:websocket:open',
diagnosticsChannel.subscribe('undici:websocket:open',
evt => {
const {
address: { address, port }
} = evt
debugLog('connection opened %s%s', address, port ? `:${port}` : '')
})
const {
address: { address, port }
} = evt
debugLog('connection opened %s%s', address, port ? `:${port}` : '')
})

diagnosticsChannel.subscribe('undici:websocket:close',
diagnosticsChannel.subscribe('undici:websocket:close',
evt => {
const { websocket, code, reason } = evt
debugLog(
'closed connection to %s - %s %s',
websocket.url,
code,
reason
)
})

diagnosticsChannel.subscribe('undici:websocket:socket_error',
const { websocket, code, reason } = evt
debugLog(
'closed connection to %s - %s %s',
websocket.url,
code,
reason
)
})

diagnosticsChannel.subscribe('undici:websocket:socket_error',
err => {
debugLog('connection errored - %s', err.message)
})
debugLog('connection errored - %s', err.message)
})

diagnosticsChannel.subscribe('undici:websocket:ping',
diagnosticsChannel.subscribe('undici:websocket:ping',
evt => {
debugLog('ping received')
})
debugLog('ping received')
})

diagnosticsChannel.subscribe('undici:websocket:pong',
diagnosticsChannel.subscribe('undici:websocket:pong',
evt => {
debugLog('pong received')
})
debugLog('pong received')
})
}

if (undiciDebugLog.enabled || fetchDebuglog.enabled) {
Expand Down

0 comments on commit 34833de

Please sign in to comment.