Skip to content

Commit

Permalink
fixup! go-template/_template/cmd/app: swapped zap logger with log/slog
Browse files Browse the repository at this point in the history
  • Loading branch information
zalgonoise committed Jul 18, 2024
1 parent 4657b70 commit 3872c0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _template/cmd/{{.Base.appName}}/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import (
)

func main() {
logger := log.New(log.WithLevel(os.Getenv("LOG_LEVEL")))
// Logger configuration
logger := log.New(
log.WithLevel(os.Getenv("LOG_LEVEL")),
log.WithSource(),
)

if err := run(logger); err != nil {
logger.ErrorContext(context.Background(), "an error occurred", slog.String("error", err.Error()))
Expand Down

0 comments on commit 3872c0b

Please sign in to comment.