fix: 修复日志文件 level 字段包含 ANSI 颜色转义码导致乱码
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m5s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m5s
This commit is contained in:
@@ -34,8 +34,8 @@ func InitLoggers(
|
||||
MessageKey: "msg",
|
||||
StacktraceKey: "stacktrace",
|
||||
LineEnding: zapcore.DefaultLineEnding,
|
||||
EncodeLevel: zapcore.CapitalColorLevelEncoder, // 使用彩色级别编码器
|
||||
EncodeTime: zapcore.ISO8601TimeEncoder, // 2025-11-11T17:50:52.830+0800 格式
|
||||
EncodeLevel: zapcore.CapitalLevelEncoder, // 使用无颜色级别编码器,避免文件日志出现 ANSI 转义码乱码
|
||||
EncodeTime: zapcore.ISO8601TimeEncoder, // 2025-11-11T17:50:52.830+0800 格式
|
||||
EncodeDuration: zapcore.SecondsDurationEncoder,
|
||||
EncodeCaller: zapcore.ShortCallerEncoder, // 输出 middleware/trace.go:58 格式
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user