From 1e9f7b83d0881838bb4e4ca5d8a68c50f7259cfe Mon Sep 17 00:00:00 2001 From: Jorge Barnaby Date: Thu, 16 Apr 2020 19:39:32 -0400 Subject: [PATCH] [@types/pino-http] Add missing getPath to autoLoggingOptions (#43948) * Add missing getPath to autoLoggingOptions * Update pino-http-tests.ts * Update index.d.ts * Updates --- types/pino-http/index.d.ts | 4 +++- types/pino-http/pino-http-tests.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/pino-http/index.d.ts b/types/pino-http/index.d.ts index 8d685e7998..5ac016d2c7 100644 --- a/types/pino-http/index.d.ts +++ b/types/pino-http/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for pino-http 4.4 +// Type definitions for pino-http 5.0 // Project: https://github.com/pinojs/pino-http#readme // Definitions by: Christian Rackerseder // Jeremy Forsythe // Griffin Yourick +// Jorge Barnaby // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 @@ -38,6 +39,7 @@ declare namespace PinoHttp { interface autoLoggingOptions { ignorePaths?: string[]; + getPath?: (req: IncomingMessage) => string | undefined; } } diff --git a/types/pino-http/pino-http-tests.ts b/types/pino-http/pino-http-tests.ts index 900cf16daf..84e37aa730 100644 --- a/types/pino-http/pino-http-tests.ts +++ b/types/pino-http/pino-http-tests.ts @@ -20,6 +20,7 @@ pinoHttp({ useLevel: 'error' }); pinoHttp({ prettyPrint: true }); pinoHttp({ autoLogging: false }); pinoHttp({ autoLogging: { ignorePaths: ['/health'] } }); +pinoHttp({ autoLogging: { ignorePaths: ['/health'], getPath: (req) => req.url } }); pinoHttp(new Writable()); pinoHttp({ customLogLevel(req, res) {