使用最新版本的logrus
(v1.4.2),我无法在日志格式化程序中设置毫秒/微秒。
在以前的版本(我不记得是哪个版本)中,我只是使用以下时间格式:
Formatter := new(log.TextFormatter)
Formatter.TimestampFormat = "15-01-2018 15:04:05.000000"
Formatter.FullTimestamp = true
Formatter.ForceColors = true
log.setformatter(Formatter)
log.SetLevel(log.DebugLevel)
不幸的是,在最新版本中,似乎不再允许使用此时间戳格式。
当我尝试以上述时间格式打印行时,收到以下结果:17-11-7118 17:35:46.314715
代替正确的一个:7-11-2019 17:35:46.314715
有人知道如何配置Logrus
来以 microsecond / millisecond 精度打印时间戳吗?