( request: NodeNextRequest, response: NodeNextResponse, loggingConfig: LoggingConfig, requestStartTime: bigint, requestEndTime: bigint, devRequestTimingMiddlewareStart: bigint | undefined, devRequestTimingMiddlewareEnd: bigint | undefined, devRequestTimingInternalsEnd: bigint | undefined, devGenerateStaticParamsDuration: bigint | undefined )
| 41 | } |
| 42 | |
| 43 | export function logRequests( |
| 44 | request: NodeNextRequest, |
| 45 | response: NodeNextResponse, |
| 46 | loggingConfig: LoggingConfig, |
| 47 | requestStartTime: bigint, |
| 48 | requestEndTime: bigint, |
| 49 | devRequestTimingMiddlewareStart: bigint | undefined, |
| 50 | devRequestTimingMiddlewareEnd: bigint | undefined, |
| 51 | devRequestTimingInternalsEnd: bigint | undefined, |
| 52 | devGenerateStaticParamsDuration: bigint | undefined |
| 53 | ): void { |
| 54 | if (!ignoreLoggingIncomingRequests(request, loggingConfig)) { |
| 55 | logIncomingRequests( |
| 56 | request, |
| 57 | requestStartTime, |
| 58 | requestEndTime, |
| 59 | response.statusCode, |
| 60 | devRequestTimingMiddlewareStart, |
| 61 | devRequestTimingMiddlewareEnd, |
| 62 | devRequestTimingInternalsEnd, |
| 63 | devGenerateStaticParamsDuration |
| 64 | ) |
| 65 | |
| 66 | // Log server action after the request log |
| 67 | const serverActionLog = getRequestMeta(request, 'devServerActionLog') |
| 68 | if (serverActionLog) { |
| 69 | const argsStr = formatArgs(serverActionLog.args) |
| 70 | process.stdout.write( |
| 71 | ` └─ ƒ ${serverActionLog.functionName}(${argsStr}) in ${serverActionLog.duration}ms ${dim(serverActionLog.location)}\n` |
| 72 | ) |
| 73 | removeRequestMeta(request, 'devServerActionLog') |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | if (request.fetchMetrics) { |
| 78 | for (const fetchMetric of request.fetchMetrics) { |
| 79 | logFetchMetric(fetchMetric, loggingConfig) |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | function logIncomingRequests( |
| 85 | request: NodeNextRequest, |
no test coverage detected