import { t as LoggerOptionsFactory } from "../construct-BGlPfWMF.js"; import { Bindings, Bindings as Bindings$1, Logger, Logger as Logger$1, LoggerOptions } from "pino"; //#region src/observability/request-route.d.ts /** * Report the route that actually served the current request, overriding the one * astro's routing matched. * * A middleware that rewrites (`next(url)`) or answers with its own response * serves a request astro has no page for, so routing matches `/404` and that is * what the request is logged and measured as — every such request collapsing * into one `/404` bucket in the request metrics. Calling this corrects the log * line, the metric and the server span name together. * * Pass a templated label rather than a concrete path, so metric cardinality * stays bounded. No-op outside instrumented requests. * * @example * ```ts * import { overrideRequestRoute } from '@astroscope/node/log'; * * export const onRequest: MiddlewareHandler = (ctx, next) => { * const page = lookupPage(ctx.url.pathname); * * if (!page) return next(); * * overrideRequestRoute('/cms/pages/[id]'); * * return next(`/cms/pages/${page.id}`); * }; * ``` */ export declare function overrideRequestRoute(route: string): void; //#endregion //#region src/observability/log/index.d.ts /** @internal */ export declare function generateReqId(): string; export interface LogProxy { readonly trace: Logger$1['trace']; readonly debug: Logger$1['debug']; readonly info: Logger$1['info']; readonly warn: Logger$1['warn']; readonly error: Logger$1['error']; readonly fatal: Logger$1['fatal']; child(bindings: Bindings$1): LogProxy; /** the current context's pino logger */ readonly raw: Logger$1; readonly root: Logger$1; } /** * Context-aware logger. Inside a request, entries carry the request bindings * (`reqId`, `req`); outside they go to the root logger. Entries logged before * the root logger is constructed (env loading, config, instrumentation) are * buffered and replayed once construction completes — the original timestamp * is kept as a `bufferedTime` field. * * @example * ```ts * import { log } from '@astroscope/node/log'; * * log.info('handling request'); * log.info({ userId: 123 }, 'user logged in'); * log.error(err, 'operation failed'); * * const dbLog = log.child({ component: 'db' }); * dbLog.debug('executing query'); * ``` */ export declare const log: LogProxy; //#endregion export type { Bindings, Logger, LoggerOptions, LoggerOptionsFactory }; //# sourceMappingURL=index.d.ts.map