-
Notifications
You must be signed in to change notification settings - Fork 1.4k
LoggingRule - Align EnableLoggingForLevels and DisableLoggingForLevels to skip when minLevel is LogLevel.Off #6011
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
Conversation
…s to skip when minLevel == LogLevel.Off
|
Warning Rate limit exceeded@snakefoot has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 54 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughUniformizes level enabling/disabling in LoggingRule: constructors now always call EnableLoggingForLevels; Enable/Disable methods add null guards and early-return when minLevel is Off; SetLoggingLevels now resets filter to Off before re-enabling the specified range. Guard checks adjusted; control flow centralized through EnableLoggingForLevels. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant LoggingRule
participant LevelFilter as Internal Level Filter
rect rgba(200,240,255,0.3)
Note over Caller,LoggingRule: Construction path (changed)
Caller->>LoggingRule: new LoggingRule(minLevel, maxLevel[, target])
LoggingRule->>LevelFilter: set Off
LoggingRule->>LoggingRule: EnableLoggingForLevels(minLevel, maxLevel)
alt minLevel == Off
LoggingRule-->>LoggingRule: early return (no levels enabled)
else
LoggingRule->>LevelFilter: enable range [minLevel..maxLevel]
end
end
rect rgba(220,255,220,0.3)
Note over Caller,LoggingRule: SetLoggingLevels (changed)
Caller->>LoggingRule: SetLoggingLevels(minLevel, maxLevel)
LoggingRule->>LevelFilter: set Off
LoggingRule->>LoggingRule: EnableLoggingForLevels(minLevel, maxLevel)
alt minLevel == Off
LoggingRule-->>LoggingRule: early return
else
LoggingRule->>LevelFilter: enable range [minLevel..maxLevel]
end
end
rect rgba(255,240,200,0.3)
Note over Caller,LoggingRule: Per-level enable/disable (guards added)
Caller->>LoggingRule: Enable/DisableLoggingForLevel(level)
alt level == Off
LoggingRule-->>Caller: no-op
else
LoggingRule->>LoggingRule: Guard.ThrowIfNull(level)
LoggingRule->>LevelFilter: toggle level on/off
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
|



No description provided.