diff --git a/types/pino/index.d.ts b/types/pino/index.d.ts index 02b66cc745..0f98e0a622 100644 --- a/types/pino/index.d.ts +++ b/types/pino/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for pino 4.7 +// Type definitions for pino 4.16 // Project: https://github.com/pinojs/pino.git // Definitions by: Peter Snider // BendingBender +// Christian Rackerseder // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -192,6 +193,10 @@ declare namespace P { trace?: WriteFn; } & { [logLevel: string]: WriteFn }); }; + /** + * key-value object added as child logger to each log line. If set to null the base child logger is not added + */ + base?: { [key: string]: any } | null; } interface PrettyOptions { diff --git a/types/pino/pino-tests.ts b/types/pino/pino-tests.ts index cc7704be77..6d226a1d92 100644 --- a/types/pino/pino-tests.ts +++ b/types/pino/pino-tests.ts @@ -49,6 +49,9 @@ pino({ } }); +pino({ base: null }); +pino({ base: { foo: 'bar' } }); + if ('pino' in log) console.log(`pino version: ${log.pino}`); log.child({a: 'property'}).info('hello child!');