From e80317f94048b60d960540144fd6f77bce9b8b28 Mon Sep 17 00:00:00 2001 From: Andrew van Rooyen Date: Mon, 9 Mar 2020 20:03:09 +0200 Subject: [PATCH] [pino] add `levelKey` option, deprecate `changeLevelName` option (#42887) --- types/pino/index.d.ts | 6 +++++- types/pino/pino-tests.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/pino/index.d.ts b/types/pino/index.d.ts index 3c2a3f315b..9c4a22a79c 100644 --- a/types/pino/index.d.ts +++ b/types/pino/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pino 5.15 +// Type definitions for pino 5.17 // Project: https://github.com/pinojs/pino.git, http://getpino.io // Definitions by: Peter Snider // BendingBender @@ -227,6 +227,10 @@ declare namespace P { /** * Changes the property `level` to any string value you pass in. Default: 'level' */ + levelKey?: string; + /** + * (DEPRECATED, use `levelKey`) Changes the property `level` to any string value you pass in. Default: 'level' + */ changeLevelName?: string; /** * Use this option to define additional logging levels. diff --git a/types/pino/pino-tests.ts b/types/pino/pino-tests.ts index c5234cd488..c7752d6cca 100644 --- a/types/pino/pino-tests.ts +++ b/types/pino/pino-tests.ts @@ -77,6 +77,7 @@ pino({ pino({ base: null }); pino({ base: { foo: 'bar' }, changeLevelName: 'severity' }); +pino({ base: { foo: 'bar' }, levelKey: 'severity' }); if ('pino' in log) console.log(`pino version: ${log.pino}`); log.child({ a: 'property' }).info('hello child!');