Skip to content

Extend WithLazy method to SugaredLogger #1377

@d3fvxl

Description

@d3fvxl

Hi, zap maintainers!

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

The recently added WithLazy method is amazing (PR: #1319). This capability is not yet available for SugaredLogger

Describe the solution you'd like
The straightforward idea is to expose a similar signature from SugaredLogger using WithLazy method :

func (s *SugaredLogger) WithLazy(args ...interface{}) *SugaredLogger {
	return &SugaredLogger{base: s.base.WithLazy(s.sweetenFields(args)...)}
}

There is still overhead from the sweetenFields call, but it's nonetheless much less than using With().

Is this a breaking change?
Nope

If you approve, I'm ready to work on that because it's somewhat blocking us

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions