import { type IdentityPlugin } from "@nifrajs/core/server"; /** Structured fields logged per request. */ export interface RequestLogFields { readonly method: string; readonly path: string; readonly status: number; /** Wall-clock duration in ms (0 if the start couldn't be paired). */ readonly ms: number; } export interface LoggerOptions { /** Sink for each line. Default: `console.log(JSON.stringify(fields))`. Route to your own logger here. */ readonly log?: (fields: RequestLogFields) => void; } /** * A {@link defineIdentityPlugin} plugin that logs one structured line per request - method, path, * status, and duration - via `onRequest`/`onResponse` (so it covers 404s and errors too). The start * time is paired to the request through a `WeakMap` (no per-request allocation leak). Idempotent. * * It adds no context and registers no routes, so it is type-identity: routes declared after * `.use(logger())` keep their types. (Under `definePlugin` they would not - see that helper's * FOOTGUN note.) */ export declare function logger(options?: LoggerOptions): IdentityPlugin; //# sourceMappingURL=logger.d.ts.map