logging in Go, based on zap.
go get github.com/rumis/log4go
Note that log4go only supports the two most recent minor versions of Go, Because of zap.
ctx := context.TODO()
consoleLogger := log4go.NewConsoleLogger()
log4go.SetDefaultLogger(consoleLogger)
defer log4go.Sync(ctx)
log4go.Info(ctx, "failed to fetch URL",
log4go.String("url",url),
log4go.Int("attempt", 3),
log4go.Duration("backoff", time.Second))
See the documentation for more details.
Released under the MIT License.