From 7c723ba64ab792c600b9376230b48ff4009ebade Mon Sep 17 00:00:00 2001 From: Matt Jeanes Date: Thu, 6 Feb 2020 13:10:18 -0500 Subject: [PATCH] [@types/hapi-pino] Update hapi-pino to 6.4 (#42166) --- types/hapi-pino/hapi-pino-tests.ts | 12 ++++++++++++ types/hapi-pino/index.d.ts | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/types/hapi-pino/hapi-pino-tests.ts b/types/hapi-pino/hapi-pino-tests.ts index 385ea2079f..238aa920a6 100644 --- a/types/hapi-pino/hapi-pino-tests.ts +++ b/types/hapi-pino/hapi-pino-tests.ts @@ -58,6 +58,7 @@ function example2() { remove: true, }, logRequestStart: true, + logRequestComplete: true, prettyPrint: { levelFirst: true, colorize: true, @@ -82,3 +83,14 @@ function example3() { redact: ['test.property'], }); } + +function example4() { + server.register({ + plugin: HapiPino, + options: { + logRequestStart: (req: Request) => req.path !== '/ping', + logRequestComplete: (req: Request) => req.path !== '/ping', + getChildBindings: (req: Request) => ({}), + }, + }); +} diff --git a/types/hapi-pino/index.d.ts b/types/hapi-pino/index.d.ts index 388a38b5d7..3ab242e5e6 100644 --- a/types/hapi-pino/index.d.ts +++ b/types/hapi-pino/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for hapi-pino 6.3 +// Type definitions for hapi-pino 6.4 // Project: https://github.com/pinojs/hapi-pino#readme // Definitions by: Rodrigo Saboya // Todd Bealmear @@ -30,7 +30,8 @@ declare namespace HapiPino { interface Options { logPayload?: boolean; logRouteTags?: boolean; - logRequestStart?: boolean; + logRequestStart?: boolean | ((req: Request) => boolean); + logRequestComplete?: boolean | ((req: Request) => boolean); stream?: NodeJS.WriteStream; prettyPrint?: boolean | pino.PrettyOptions; tags?: { [key in pino.Level]?: string };