您能告诉我如何在日志中打印/写入文件时添加时间戳吗?当日志被打印到文件中时,它意味着it shows current data and time。const consoleLogger = new winston.transports.Console({ const today= moment();
return today.format("DD-MM
我正在开发一个Node.js应用程序,使用作为ES6转换程序,我使用作为我的日志记录服务。我希望温斯顿记录器的所有信息输出都是彩色的,不仅仅是标签和信息,还有时间戳。我知道,在温斯顿2.x中,这在某种程度上是可能的(不知道怎么做到的)。 import winston from 'winston' let alignColorsAndTi