diff --git a/types/pino-http/index.d.ts b/types/pino-http/index.d.ts index b0fea321aa..4c7a8d62c3 100644 --- a/types/pino-http/index.d.ts +++ b/types/pino-http/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for pino-http 4.0 +// Type definitions for pino-http 4.3 // Project: https://github.com/pinojs/pino-http#readme // Definitions by: Christian Rackerseder +// Jeremy Forsythe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 @@ -15,11 +16,17 @@ declare function PinoHttp(stream?: DestinationStream): PinoHttp.HttpLogger; declare namespace PinoHttp { type HttpLogger = (req: IncomingMessage, res: ServerResponse) => void; + /** + * Options for pino-http + * + * See https://github.com/pinojs/pino-http#pinohttpopts-stream + */ interface Options extends LoggerOptions { logger?: Logger; genReqId?: GenReqId; useLevel?: Level; stream?: DestinationStream; + autoLogging?: boolean; customLogLevel?: (res: ServerResponse, error: Error) => Level; } diff --git a/types/pino-http/pino-http-tests.ts b/types/pino-http/pino-http-tests.ts index 013e23ae10..64d3b0d2ba 100644 --- a/types/pino-http/pino-http-tests.ts +++ b/types/pino-http/pino-http-tests.ts @@ -17,5 +17,6 @@ pinoHttp({ genReqId: (req) => 'foo' }); pinoHttp({ genReqId: (req) => Buffer.allocUnsafe(16) }); pinoHttp({ useLevel: 'error' }); pinoHttp({ prettyPrint: true }); +pinoHttp({ autoLogging: false }); pinoHttp(new Writable()); pinoHttp({ customLogLevel(req, res) { return 'info'; } });