This commit is contained in:
GP
2018-08-20 10:54:29 +05:30
parent ee84ef5f4f
commit 7f930beb54
2 changed files with 14 additions and 1 deletions
+10 -1
View File
@@ -1,8 +1,9 @@
// Type definitions for pino 4.16
// Type definitions for pino 5.20
// 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>
// GP <https://github.com/paambaati>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -145,6 +146,10 @@ declare namespace P {
* requires supplying a level value via `levelVal`. Default: 'info'.
*/
level?: LevelWithSilent | string;
/**
* Outputs the level as a string instead of integer. Default: `false`.
*/
useLevelLabels?: boolean;
/**
* When defining a custom log level via level, set to an integer value to define the new level. Default: `undefined`.
*/
@@ -268,6 +273,10 @@ declare namespace P {
* You can pass `'silent'` to disable logging.
*/
level: LevelWithSilent | string;
/**
* Outputs the level as a string instead of integer.
*/
useLevelLabels: boolean;
/**
* Returns the integer value for the logger instance's logging level.
*/
+4
View File
@@ -96,3 +96,7 @@ pino.levels.labels[50] === 'error';
const logstderr: pino.Logger = pino(process.stderr);
logstderr.error('on stderr instead of stdout');
log.useLevelLabels = true;
log.info('lol');
log.level === 'info';