Skip to content

Automated log formatting code generation for uber/zap using lyft/proto-gen-star

License

Notifications You must be signed in to change notification settings

bigbluedisco/protoc-gen-zap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protoc-gen-zap

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)
)

Requirements

running tests

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

About

Automated log formatting code generation for uber/zap using lyft/proto-gen-star

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages