Compatibility
- LogSeverity - is mapped from zap log level.
- HttpRequest - using HTTPRequest
- LogEntryOperation - through operation package interface
- LogEntrySourceLocation - it's filled automatically, due to Go limitations function name is missing
- serviceContext - using ServiceContext
Benchmarks
Custom EncodeEntry does not slows down zap significantly.
goos: darwin
goarch: amd64
pkg: github.com/piotrkowalczuk/zapstackdriver
BenchmarkEncoder/production-2 1000000 1321 ns/op 321 B/op 3 allocs/op
BenchmarkEncoder/development-2 200000 7150 ns/op 536 B/op 12 allocs/op
BenchmarkEncoder/stackdriver-2 1000000 1332 ns/op 325 B/op 3 allocs/op
PASS
ok github.com/piotrkowalczuk/zapstackdriver 4.225s