Warning: this is an early version - do not use in production
Automated code generation for your protobuf objects to implement zap.ObjectMarshaler
, based on lyft/protoc-gen-star
This is useful to log protobuf objects in zap without heavy reflection:
l, _ := zap.NewProduction()
l.Info("create-user",
zap.Object("user", user)
)
Code generation is done in the protoc
flow:
go install . && protoc -I . -I ${GOPATH}/src --go_out=":./test" --zap_out="lang=go:./test" test/test.proto