MCPcopy Create free account
hub / github.com/langgenius/dify / logResponse

Function logResponse

cli/src/http/hooks.ts:33–47  ·  view source on GitHub ↗
(logger: HttpLogger)

Source from the content-addressed store, hash-verified

31}
32
33export function logResponse(logger: HttpLogger): Hook {
34 return ({ request, response, meta }) => {
35 if (response === undefined)
36 return
37 const start = meta.get(HTTP_START_SYM)
38 const durationMs = typeof start === 'number' ? performance.now() - start : undefined
39 logger({
40 phase: 'response',
41 method: request.method,
42 url: redactBearer(request.url),
43 status: response.status,
44 durationMs,
45 })
46 }
47}
48
49export const classifyTransport: Hook = (ctx) => {
50 if (ctx.error === undefined)

Callers 1

compileStateFunction · 0.85

Calls 3

redactBearerFunction · 0.85
nowMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected