123456789101112131415 |
- package logs
- import (
- "time"
- "go.uber.org/zap/zapcore"
- )
- func timeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
- enc.AppendString(t.Format("2006-01-02 15:04:05.000"))
- }
- func milliSecondsDurationEncoder(d time.Duration, enc zapcore.PrimitiveArrayEncoder) {
- enc.AppendFloat64(float64(d) / float64(time.Millisecond))
- }
|