mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-26 10:14:26 +08:00
@types/pino: recognize changeLevelName field (#29624)
This field has been supported since pino 5.4.0, API [docs are here][api]. [api]:https://github.com/pinojs/pino/blob/master/docs/api.md#changelevelname-string
This commit is contained in:
4
types/pino/index.d.ts
vendored
4
types/pino/index.d.ts
vendored
@@ -150,6 +150,10 @@ declare namespace P {
|
||||
* Outputs the level as a string instead of integer. Default: `false`.
|
||||
*/
|
||||
useLevelLabels?: boolean;
|
||||
/**
|
||||
* Changes the property `level` to any string value you pass in. Default: 'level'
|
||||
*/
|
||||
changeLevelName?: string;
|
||||
/**
|
||||
* Use this option to define additional logging levels.
|
||||
* The keys of the object correspond the namespace of the log level, and the values should be the numerical value of the level.
|
||||
|
||||
@@ -50,7 +50,7 @@ pino({
|
||||
});
|
||||
|
||||
pino({ base: null });
|
||||
pino({ base: { foo: 'bar' } });
|
||||
pino({ base: { foo: 'bar' } , changeLevelName: 'severity' });
|
||||
|
||||
if ('pino' in log) console.log(`pino version: ${log.pino}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user