简体   繁体   English

如何设置Winston日期格式字符串以获取微秒分辨率?

[英]How to set Winston date format string to get microseconds resolution?

I have the following Winston logger format: 我有以下Winston记录器格式:

simple(),
colorize(),
timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' })

Which gives me timestamps in milliseconds resolution. 这给了我毫秒级的时间戳。 What should I change in the format string to get the timestamp in microseconds? 我应该如何更改格式字符串以获取以毫秒为单位的时间戳?

So it turns out microseconds resolution is not supported in Winston. 因此,事实证明Winston不支持微秒分辨率。 Winston is using fecha under the hood for timestamp formatting, and fecha does not support microseconds resolution at the moment. Winston在后台使用fecha进行时间戳格式设置,fecha目前不支持微秒分辨率。 I opened the following github issue requesting fecha to add this feature. 我打开了以下github问题,要求fecha添加此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM