fix: streams can be named

as documented in <https://github.com/trentm/node-bunyan#levels>
This commit is contained in:
Robert K. Bell
2017-08-09 16:27:28 +10:00
parent 825d361b8e
commit 8b2363e487
2 changed files with 11 additions and 1 deletions
+10 -1
View File
@@ -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' });
+1
View File
@@ -228,6 +228,7 @@ declare namespace Logger {
closeOnExit?: boolean;
period?: string;
count?: number;
name?: string;
}
interface LoggerOptions {