import { Options } from 'pino-http' ; import { Logger , DestinationStream } from 'pino' ; import { MiddlewareConfigProxy , ModuleMetadata , } from '@nestjs/common/interfaces' ; export type PassedLogger = { logger : Logger ; } ; export interface Params { see https pinoHttp ? : Options | DestinationStream | [ Options , DestinationStream ] ; see https exclude ? : Parameters < MiddlewareConfigProxy [ 'exclude' ] > ; see https forRoutes ? : Parameters < MiddlewareConfigProxy [ 'forRoutes' ] > ; see https useExisting ? : true ; /**
     * Optional parameter to change property name `context` in resulted logs,
     * so logs will be like:
     * {"level":30, ... "RENAME_CONTEXT_VALUE_HERE":"AppController" }
     */ renameContext ? : string ; } export interface LoggerModuleAsyncParams extends Pick < ModuleMetadata , 'imports' | 'providers' > { useFactory : ( ... args : any [ ] ) => Params | Promise < Params > ; inject ? : any [ ] ; } export function isPassedLogger ( pinoHttpProp ) { return ! ! pinoHttpProp && 'logger' in pinoHttpProp ; } export const PARAMS_PROVIDER_TOKEN = 'pino-params' ;