import { Request, Response, NextFunction } from 'express'; import type { FastifyInstance, FastifyRequest } from 'fastify'; import { Level, Context } from './models'; import { Sanitizer, LogRecord, registerSanitizer, clearSanitizers } from './sanitizers'; declare const getContext: () => Context; declare const runWithContext: (context: Context, fn: () => T) => T; /** * Clears the current scope's context entirely, the `request` the resolver put there included, so * every later record in the scope loses `client.ip`, `user_agent.original`, `http.request.referrer` * and `url.original`. Outside a scope it does nothing. * * Inside a request there is rarely a reason to call it. To run work under a different context, open * a scope for it with `runWithContext()`; this is for a long-lived scope that moves from one unit of * work to the next. */ declare const resetContext: () => void; declare const setContext: (value: any) => void; declare const context: Context; declare const logToStdout: (level: Level, msg: string | Error, ...rawParams: any[]) => void; declare const patchConsoleLog: () => void; declare const registerErrorHandler: () => void; declare const setup: (options?: { appIdentifier?: string; }) => void; declare const applyFastifyRoutes: (fastify: FastifyInstance) => void; declare const expressMiddleware: () => (req: Request, res: Response, next: NextFunction) => Response> | undefined; declare const contextResolverMiddleware: () => (req: Request, res: Response, next: NextFunction) => void; declare const contextResolverHook: () => (req: FastifyRequest, _reply: unknown, done: () => void) => void; export { context, getContext, runWithContext, setup, resetContext, setContext, patchConsoleLog, registerErrorHandler, expressMiddleware, applyFastifyRoutes, logToStdout, contextResolverMiddleware, contextResolverHook, registerSanitizer, clearSanitizers, }; export type { Sanitizer, LogRecord, Context };