boilerplate
boilerplate copied to clipboard
switch logging to slog
Description
Fixes #82.
Currently all logging is done via utils.Logger
which just outputs logging to stdout
. It would be nice to have more control over logging by silencing logging when not needed or injecting a separate logger (compatible with *slog.Logger
).
There is a lot of lines of change here, but it's just creating a slog.Handler
that prefixes [boilerplate]
to log lines to maintain the existing look and passing an instance of the logger throughout. go
is not my primary language though, any feedback is greatly appreciated!
NOTE: This does bump the minimum go version to 1.21
.
TODOs
Read the Gruntwork contribution guidelines.
- [ ] Update the docs.
- [ ] Run the relevant tests successfully, including pre-commit checks.
- [ ] Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
- [ ] Include release notes. If this PR is backward incompatible, include a migration guide.
Release Notes (draft)
Updated logging to use slog
library.
Migration Guide
None