From 1fab8efd0f3bbc7d4568929a010c060dff8a305e Mon Sep 17 00:00:00 2001 From: lvlcn-t <75443136+lvlcn-t@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:43:46 +0100 Subject: [PATCH] chore: adjust examples to new logger.Opts --- examples/custom-handler/main.go | 2 +- examples/extension/main.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/custom-handler/main.go b/examples/custom-handler/main.go index a4f2701..665acc5 100644 --- a/examples/custom-handler/main.go +++ b/examples/custom-handler/main.go @@ -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.") diff --git a/examples/extension/main.go b/examples/extension/main.go index 5a4ac84..7a5cea3 100644 --- a/examples/extension/main.go +++ b/examples/extension/main.go @@ -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, }), - ), + }), } }