温斯顿logging器名称

Flatiron的日志库Winston是相当有用的,但我不知道如何分配名称logging器。 我期待输出类似于其他日志库,例如:

[<date>] [<log level>] <logger name> - <the message> 

有没有可能以这种方式configuration温斯顿?

谢谢。

在创build日志传输时,可以提供一个label参数,将其添加到日志级别和日志消息之间的日志输出中。 例如:

 var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)({ colorize: true, prettyPrint: true, timestamp: true, label: 'CustomLabel' }) ] }); 

这将导致以下输出:

 2016-09-06T12:16:17.335Z - info: [CustomLabel] hello 

你可以命名伐木者 ; 但是,似乎没有办法将logging器名称添加到输出中。

但是如果可以的话,我也会使用它。 有一个开放的拉请求 ,可以通过在输出string中添加一个“名称”来实现,所以希望能够通过。