-
Notifications
You must be signed in to change notification settings - Fork 3.4k
pkg/maps: migrate to slog #38373
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
pkg/maps: migrate to slog #38373
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
e43a847
to
70795ea
Compare
This comment was marked as resolved.
This comment was marked as resolved.
70795ea
to
4505cb7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
4505cb7
to
7ef7878
Compare
/test |
7ef7878
to
cc582de
Compare
/test |
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.
Oof, I'm not a fan of adding a Logger
to bpf.Map and ebpf.Map. As far as I can see, they're only used to log the map removal warnings in OpenOrCreate, which is behaviour we want/need to get rid of anyway.
Can we keep using the default logger for those? Passing a logger to all functions returning a map really causes a ton of churn.
I understand but we can't keep the default logrus if we want to migrate to slog and keep consistency across all pkgs. Unfortunately, the way that slog is designed it can't be configured on |
febb39c
to
6f136b0
Compare
/test |
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.
Copilot reviewed 58 out of 58 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (4)
pkg/loadbalancer/experimental/bpf_reconciler_test.go:972
- Verify that the 'log' variable being assigned to BPFLBMaps.Log is of type *slog.Logger to ensure the migration is consistent across the code.
Log: log,
pkg/ebpf/map.go:60
- Ensure that all call sites are updated to pass a valid slog.Logger when invoking NewMap, LoadRegisterMap, LoadPinnedMap, and MapFromID to prevent runtime logging issues.
func NewMap(logger *slog.Logger, spec *MapSpec) *Map {
pkg/ebpf/ebpf.go:1
- Confirm that the removal of pkg/ebpf/ebpf.go is intentional and that any dependent imports or references in the codebase have been updated accordingly.
// file removed
pkg/bpf/map_linux.go:194
- [nitpick] Consider refactoring the logger injection approach to eliminate the TODO comment and implement a more consistent dependency injection pattern for the logger.
// TODO inject the logger in a better way than this.
6f136b0
to
565cbc9
Compare
/test |
565cbc9
to
63c1e8a
Compare
/test |
63c1e8a
to
73a46cc
Compare
/test |
73a46cc
to
bb6c98b
Compare
/test |
bb6c98b
to
51d2de5
Compare
/test |
51d2de5
to
8a75f02
Compare
/test |
@pchaigno @aditighag can you PTAL? |
/test |
/test |
Migrate this package to use slog instead of logrus. Signed-off-by: André Martins <andre@cilium.io>
/test |
Migrate this package to use slog instead of logrus.