Switched Android from go-kit/log to slog - #39785
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #39785 +/- ##
=======================================
Coverage 66.26% 66.26%
=======================================
Files 2438 2439 +1
Lines 195266 195333 +67
Branches 8643 8643
=======================================
+ Hits 129386 129443 +57
- Misses 54167 54169 +2
- Partials 11713 11721 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
WalkthroughThis PR systematically migrates Android MDM logging from the go-kit/log framework to the standard library slog across multiple components. The migration updates function signatures to accept Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 4❌ Failed checks (4 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR migrates Android MDM services from go-kit/log to slog as part of the broader logging modernization effort. The changes update service signatures, logging calls, and test initialization to use slog's structured logging with proper context propagation.
Changes:
- Updated Android service signatures to accept
*slog.Loggerinstead ofkitlog.Logger - Converted all logging calls from go-kit/log's
level.X(logger).Log()pattern to slog'slogger.XContext(ctx, ...)pattern - Updated test code to create slog loggers and use
logging.Loggerwrapper for components requiring kitlog interface
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server/worker/software_worker.go | Changed QueueRunAndroidSetupExperience signature to accept *slog.Logger and updated logging call |
| server/service/integrationtest/android/suite.go | Updated to call .SlogLogger() when passing logger to Android service |
| server/service/integration_mdm_test.go | Updated Android service initialization to use .SlogLogger() method |
| server/service/integration_android_certificate_templates_test.go | Updated test logger initialization to use slog.New(logging.DiscardHandler{}) |
| server/mdm/android/tests/testing_utils.go | Updated test setup to create slog logger and wrap with logging.NewLogger() for kitlog compatibility |
| server/mdm/android/service/service.go | Changed service logger field and constructor to use *slog.Logger, converted all logging calls |
| server/mdm/android/service/reconcile_devices.go | Updated ReconcileAndroidDevices signature and logging calls to use slog |
| server/mdm/android/service/pubsub_test.go | Updated test logger initialization to use slog |
| server/mdm/android/service/pubsub.go | Converted all logging calls to slog pattern with context |
| server/mdm/android/service/profiles_test.go | Updated test loggers to use slog.New(logging.DiscardHandler{}) |
| server/mdm/android/service/profiles.go | Updated ReconcileProfiles and related function signatures to accept *slog.Logger |
| server/mdm/android/service/enterprises_test.go | Updated test setup to use logging.NewLogfmtLogger() and call .SlogLogger() |
| server/mdm/android/service/certificate_renewal.go | Updated RenewCertificateTemplates signature and logging to use slog |
| server/mdm/android/service/androidmgmt/proxy_client.go | Changed ProxyClient logger field and constructor to use *slog.Logger, converted logging calls |
| server/mdm/android/service/androidmgmt/google_client.go | Changed GoogleClient logger field and constructor to use *slog.Logger, converted logging calls |
| cmd/fleet/serve.go | Updated Android service initialization to pass .SlogLogger() |
| cmd/fleet/cron.go | Updated cron job calls to pass .SlogLogger() for Android service functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related issue: Resolves #39785
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.Testing
Summary by CodeRabbit