@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:
Nathan Hamblen
2018-10-11 13:46:54 -04:00
committed by Andy
parent 1df7a9325c
commit aa83866295
2 changed files with 5 additions and 1 deletions

View File

@@ -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.

View File

@@ -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}`);