MCPcopy
hub / github.com/uber-go/zap / MarshalLogObject

Method MarshalLogObject

benchmarks/zap_test.go:99–104  ·  view source on GitHub ↗
(enc zapcore.ObjectEncoder)

Source from the content-addressed store, hash-verified

97}
98
99func (u *user) MarshalLogObject(enc zapcore.ObjectEncoder) error {
100 enc.AddString("name", u.Name)
101 enc.AddString("email", u.Email)
102 enc.AddInt64("createdAt", u.CreatedAt.UnixNano())
103 return nil
104}
105
106func newZapLogger(lvl zapcore.Level) *zap.Logger {
107 ec := zap.NewProductionEncoderConfig()

Callers

nothing calls this directly

Calls 2

AddStringMethod · 0.65
AddInt64Method · 0.65

Tested by

no test coverage detected