Merge pull request #25819 from screendriver/pino

[pino] Fixed typings
This commit is contained in:
Daniel Rosenwasser
2018-05-23 16:43:14 -07:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

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

View File

@@ -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!');