zipkin-go
zipkin-go copied to clipboard
Add structured Logger interface
We should provide a standard structured logger interface which consumers can inject with an implementation. zipkin-go-opentracing uses an interface compatible with the Go kit logger interface which seems the best candidate.
type Logger interface {
Log(keyvals ...interface{}) error
}
This will allow people to easily fetch the K/V pairs coming from errors and exceptions within the library and merge them with their application logging infrastructure.
For people not liking structured logging we should provide an adapter for the standard Go log.
Ahh so this is so that the logging internal to the library is abstracted, right? Ex this is only used by tracing code.
Yes that is correct. It allows the user of the library decide how to have errors be reported.
I took a pass at implementing a more complete version of this to use interfaces throughout the package: https://github.com/openzipkin/zipkin-go/pull/188
I would appreciate this feature as well. I would like to integrate zap logger using an interface.