Merge pull request #11057 from rundef/master

[pino]: Fix constructor argument stream typing
This commit is contained in:
Zhengbo Li
2016-09-07 10:33:15 -07:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -26,6 +26,12 @@ var instance = PINO({
}
})
var pretty = PINO.pretty()
var instance2 = PINO({
name: 'app',
safe: true
}, pretty)
var logger = instance
logger.child({ a: 'property' }).info('hello child!')

4
pino/pino.d.ts vendored
View File

@@ -41,8 +41,8 @@ declare module 'pino' {
}
interface Pino {
(optionsOrStream?: LoggerOptions | stream.Writable): Logger
(options: LoggerOptions, stream: stream.Writable): Logger
(optionsOrStream?: LoggerOptions | stream.Writable | stream.Readable): Logger
(options: LoggerOptions, stream: stream.Writable | stream.Readable): Logger
levels: {
values: LevelLabelsToValues
labels: LevelValuesToLabels