uber-go / zap

Blazing fast, structured, leveled logging in Go.

Home Page:https://pkg.go.dev/go.uber.org/zap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `Log`, `Logf`, `Logln` and `Logw` to Suggared logger

arxeiss opened this issue · comments

Is your feature request related to a problem? Please describe.

When I need to do a wrapper around Zap logger to pass that into 3rd party library for unifying logging, it might come handy to use zap.Log(level, ...) instead of switch or if-else if chain.

However, now I need to do a same wrapper but with Sugared logger. And that doesn't support general Log method.

Describe the solution you'd like

func (s *SugaredLogger) Log(lvl zapcore.Level, args ...interface{}) {
	s.log(lvl, "", args, nil)
}

and the same for Logf, Logln and Logw.

Describe alternatives you've considered
none

Is this a breaking change?
No, this is not breaking change

Closing since #1406 was merged.