6 "github.com/samuel/go-zookeeper/zk"
8 "github.com/go-kit/kit/log"
11 // wrapLogger wraps a Go kit logger so we can use it as the logging service for
12 // the ZooKeeper library, which expects a Printf method to be available.
13 type wrapLogger struct {
17 func (logger wrapLogger) Printf(format string, args ...interface{}) {
18 logger.Log("msg", fmt.Sprintf(format, args...))
21 // withLogger replaces the ZooKeeper library's default logging service with our
23 func withLogger(logger log.Logger) func(c *zk.Conn) {
24 return func(c *zk.Conn) {
25 c.SetLogger(wrapLogger{logger})