From cd8441d87f4ec73ee4e31a24c2f6399e4704f50a Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Thu, 28 Feb 2019 16:38:40 +0000 Subject: [PATCH] pino-http: add `customLogLevel` option --- types/pino-http/index.d.ts | 1 + types/pino-http/pino-http-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/pino-http/index.d.ts b/types/pino-http/index.d.ts index 54ac4e9149..f29dfaadd6 100644 --- a/types/pino-http/index.d.ts +++ b/types/pino-http/index.d.ts @@ -20,6 +20,7 @@ declare namespace PinoHttp { genReqId?: GenReqId; useLevel?: Level; stream?: DestinationStream; + customLogLevel?: (res: unknown, error: unknown) => Level } interface GenReqId { diff --git a/types/pino-http/pino-http-tests.ts b/types/pino-http/pino-http-tests.ts index 8a86bf08e8..105f26b638 100644 --- a/types/pino-http/pino-http-tests.ts +++ b/types/pino-http/pino-http-tests.ts @@ -18,3 +18,4 @@ pinoHttp({ genReqId: (req) => Buffer.allocUnsafe(16) }); pinoHttp({ useLevel: 'error' }); pinoHttp({ prettyPrint: true }); pinoHttp(new Writable()); +pinoHttp({ customLogLevel(req, res) { return 'info' } });