[@types/pino-http] Add missing getPath to autoLoggingOptions (#43948)

* Add missing getPath to autoLoggingOptions

* Update pino-http-tests.ts

* Update index.d.ts

* Updates
This commit is contained in:
Jorge Barnaby
2020-04-16 19:39:32 -04:00
committed by GitHub
parent 98d8f8e220
commit 1e9f7b83d0
2 changed files with 4 additions and 1 deletions

View File

@@ -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 <https://github.com/screendriver>
// Jeremy Forsythe <https://github.com/jdforsythe>
// Griffin Yourick <https://github.com/tough-griff>
// Jorge Barnaby <https://github.com/yorch>
// 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;
}
}

View File

@@ -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) {