-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zapslog: Drop HandlerOptions.New, use NewHandler
The pattern of constructors for zapslog.Handler was previously: type HandlerOptions struct{ ... } func (*HandlerOptions) New(zapcore.Core) *Handler func NewHandler(zapcore.Core) *Handler This was modeled after similar constructors in slog for JSON and Text handlers. slog has since dropped those constructors in favor of simple: func NewJSONHandler(io.Writer, *HandlerOptions) *JSONHandler func NewTextHandler(io.Writer, *HandlerOptions) *TextHandler This change similarly drops the options.New method and default no-argument constructor in favor of: func NewHandler(zapcore.Core, *HandlerOptions) *Handler As with slog's JSON or Text handlers, the first argument is the destination: an io.Writer for JSON and Text, a Zap core for us. Refs golang/go#59339
- Loading branch information
Showing
3 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters