refactor: replace logrus with log/slog and tint#88
Conversation
Swap the deprecated logrus logger for the standard-library log/slog with the lmittmann/tint handler for colored, human-readable output. - Logs now write to stderr (was stdout), per CLI convention - Color auto-disables when output is not a TTY - logrus Trace/Debug both map to slog.Debug; --debug raises the threshold - log.Fatal becomes slog.Error + os.Exit(1)
|
Warning Review limit reached
More reviews will be available in 41 minutes and 27 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. 📝 WalkthroughWalkthroughReplaces logrus → slog/tint migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
cycler.go (1)
27-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPreserve the RPC errors in these retry/fallback logs. These branches only emit generic failure messages, so the reconnect loop loses the reason Discord rejected the payload or dropped the connection. Attach
err/err1/err2to the log records, including both 59-73 paths.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cycler.go` at line 27, The retry/fallback logging in the cycler flow is dropping the underlying RPC failure details, so update the affected slog.Warn branches to include the relevant error values. In the reconnect/activity handling paths in cycler.go, preserve the reason Discord rejected the payload or disconnected by attaching err, err1, and err2 to the log records in both the 59-73 branches and the generic reconnect fallback message. Use the existing logging points around the activity keep/reconnect logic so the error context is emitted with each warning.rpc.go (1)
23-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the login error on the warning path.
rpcClient.Login()failures should include the returned error here too, so auth/transport problems aren’t reduced to a generic warning.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rpc.go` around lines 23 - 25, The login failure handling in rpcClient.Login() is dropping the returned error and only emitting a generic warning. Update the warning path in the login flow to include the err from rpcClient.Login() alongside the existing context/logout behavior, using the same login branch so auth or transport failures are preserved in the warning output.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@cycler.go`:
- Line 27: The retry/fallback logging in the cycler flow is dropping the
underlying RPC failure details, so update the affected slog.Warn branches to
include the relevant error values. In the reconnect/activity handling paths in
cycler.go, preserve the reason Discord rejected the payload or disconnected by
attaching err, err1, and err2 to the log records in both the 59-73 branches and
the generic reconnect fallback message. Use the existing logging points around
the activity keep/reconnect logic so the error context is emitted with each
warning.
In `@rpc.go`:
- Around line 23-25: The login failure handling in rpcClient.Login() is dropping
the returned error and only emitting a generic warning. Update the warning path
in the login flow to include the err from rpcClient.Login() alongside the
existing context/logout behavior, using the same login branch so auth or
transport failures are preserved in the warning output.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e96c81a3-c756-4426-b90c-c430750937e5
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (4)
cycler.gogo.modmain.gorpc.go
Attach the dropped error values (err/err1/err2) to the keep-activity, RPC retry, reconnect, and login-failure log records so the reason Discord rejected the payload or disconnected is preserved.
Replaces the deprecated logrus logger with the standard-library
log/slogplus thetinthandler for colored output. Logs now write to stderr (was stdout) and color auto-disables when output is piped.Summary by CodeRabbit