mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 11:07:32 +08:00
7
types/pino/index.d.ts
vendored
7
types/pino/index.d.ts
vendored
@@ -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 <https://github.com/psnider>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Christian Rackerseder <https://github.com/screendriver>
|
||||
// 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 {
|
||||
|
||||
@@ -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!');
|
||||
|
||||
Reference in New Issue
Block a user