mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add nestedKey property to pino config (#41974)
This commit is contained in:
parent
e9a1379b4b
commit
723e4e8201
4
types/pino/index.d.ts
vendored
4
types/pino/index.d.ts
vendored
@ -267,6 +267,10 @@ declare namespace P {
|
||||
* The string key for the 'message' in the JSON object. Default: "msg".
|
||||
*/
|
||||
messageKey?: string;
|
||||
/**
|
||||
* The string key to place any logged object under.
|
||||
*/
|
||||
nestedKey?: string;
|
||||
/**
|
||||
* Enables pino.pretty. This is intended for non-production configurations. This may be set to a configuration
|
||||
* object as outlined in http://getpino.io/#/docs/API?id=pretty. Default: `false`.
|
||||
|
||||
@ -177,6 +177,10 @@ const withTimeFn = pino({
|
||||
timestamp: pino.stdTimeFunctions.isoTime,
|
||||
});
|
||||
|
||||
const withNestedKey = pino({
|
||||
nestedKey: 'payload',
|
||||
});
|
||||
|
||||
// Properties/types imported from pino-std-serializers
|
||||
const wrappedErrSerializer = pino.stdSerializers.wrapErrorSerializer((err: pino.SerializedError) => {
|
||||
return {...err, newProp: 'foo'};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user