Skip to content

Commit

Permalink
chore: adjust examples to new logger.Opts
Browse files Browse the repository at this point in the history
  • Loading branch information
lvlcn-t committed Mar 3, 2024
1 parent f378eb4 commit 1fab8ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/custom-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func main() {
clog.SetLevel(log.DebugLevel)

// Create a new logger with the custom handler.
l := logger.NewLogger(clog)
l := logger.NewLogger(logger.Opts{Handler: clog})

// Log some messages.
l.Debug("I'm not sure what's happening.")
Expand Down
6 changes: 3 additions & 3 deletions examples/extension/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func (l *loggerExtension) Success(msg string, args ...any) {

func NewLogger() Logger {
return &loggerExtension{
Logger: logger.NewLogger(
slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
Logger: logger.NewLogger(logger.Opts{
Handler: slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
ReplaceAttr: replaceAttr,
}),
),
}),
}
}

Expand Down

0 comments on commit 1fab8ef

Please sign in to comment.