我正在使用winston日志分析器。
我的问题是如何改变分析器的时间单位。
我代码:
this.logger.profile(`some ${jobId}`);
// do the job ....
this.logger.profile(`some ${jobId}`);
在结果中我看到:
{ ...,"message": "some 1", "durationMs":2500 ... }
我的问题是如何将时间单位从毫秒配置为秒/分钟等…
这样我就能看到
{ ...,"message": "some 1", "durationSeconds: 2.5" ... }
很遗憾,答案是否定的:winston没有提供以毫秒以外的单位提供持续时间的选项,参见:
https://github.com/winstonjs/winston/blob/master/lib/winston/profiler.js力争