Skip to content

log/zap: Allow configuring formatter independently of debug option #442

@alvaroaleman

Description

@alvaroaleman

Right now, the formatter/encoder of the log/zap package is inferred from the debug option, if its enabled a console encoder is used, otherwise a json encoder. This does not always make sense, e.G. sometimes debug log may help in production, but that should not result in unstructured logging.

It would be awesome, if another option was added to RawLoggerTo to make this configurable. Alternatively, we could use a different type for opts that contains an option for the encoder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions