mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
fix: streams can be named
as documented in <https://github.com/trentm/node-bunyan#levels>
This commit is contained in:
@@ -29,7 +29,8 @@ let options: Logger.LoggerOptions = {
|
||||
streams: [{
|
||||
type: 'stream',
|
||||
stream: process.stdout,
|
||||
level: Logger.TRACE
|
||||
level: Logger.TRACE,
|
||||
name: 'foo'
|
||||
}, {
|
||||
type: 'file',
|
||||
path: '/tmp/test.log',
|
||||
@@ -69,6 +70,14 @@ log.addSerializers(
|
||||
}
|
||||
);
|
||||
|
||||
let levels: number[] = log.levels();
|
||||
level = log.levels(0);
|
||||
log.levels('foo');
|
||||
|
||||
log.levels(0, Logger.INFO);
|
||||
log.levels(0, 'info');
|
||||
log.levels('foo', Logger.WARN);
|
||||
|
||||
let child = log.child({ name: 'child' });
|
||||
child.reopenFileStreams();
|
||||
log.addStream({ path: '/dev/null' });
|
||||
|
||||
Vendored
+1
@@ -228,6 +228,7 @@ declare namespace Logger {
|
||||
closeOnExit?: boolean;
|
||||
period?: string;
|
||||
count?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
interface LoggerOptions {
|
||||
|
||||
Reference in New Issue
Block a user