-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update to go 1.21.0, add log/slog support #72
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #72 +/- ##
==========================================
+ Coverage 98.79% 98.80% +0.01%
==========================================
Files 12 14 +2
Lines 581 588 +7
==========================================
+ Hits 574 581 +7
Misses 5 5
Partials 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Oops, I found things missing ... it has something like Zap: // Group returns an Attr for a Group Value.
// The first argument is the key; the remaining arguments
// are converted to Attrs as in [Logger.Log].
//
// Use Group to collect several key-value pairs under a single
// key on a log line, or as the result of LogValue
// in order to log a single value as multiple Attrs.
func Group(key string, args ...any) Attr {
return Attr{key, GroupValue(argsToAttrSlice(args)...)}
} |
OK. fixed |
@@ -11,7 +11,7 @@ jobs: | |||
runs-on: ubuntu-latest | |||
strategy: | |||
matrix: | |||
go: ['1.18', '1.19'] | |||
go: ['1.21'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not the best time to drop support for golang<1.21 for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go 1.21 and 1.22 is the only supported Stable versions now. https://go.dev/dl/
is this OK now?
@@ -4,6 +4,8 @@ import ( | |||
"context" | |||
"errors" | |||
"fmt" | |||
"log/slog" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a build constraint?
go 1.21.0 stdlib slog provides structured logging, in which log records include a message, a severity level, and various other attributes expressed as key-value pairs.
see https://pkg.go.dev/log/slog