heroku / docker-registry-client

A Go API client for the v2 Docker Registry API
BSD 3-Clause "New" or "Revised" License
297 stars 225 forks source link

Suppress or remove logging #18

Closed klingtnet closed 7 years ago

klingtnet commented 7 years ago

Why does the library log certain operations? Usually a library does not log anything to stdout/err, instead the output should be returned if necessary.

dmathieu commented 7 years ago

You can suppress logging:

r := registry.New(url, username, password)
r.Logf = func(format string, args ...interface{}) {
  // Make this a noop
}
samifruit514 commented 7 years ago

registry.New is calling Ping() from newFromTransport method and Ping() outputs logging with

r.Logf("registry.ping url=%s", url).

Is there any way we can set the Logf method before the New call?