Replaced Warn with Event for Log Messages#1
Conversation
📝 WalkthroughWalkthroughTwo logging calls in FDWNCore.cs have been changed from Logger.Warning(...) to Logger.Event(...) for collectibles and blocks during AssetsFinalize. A newline is added at end-of-file. No functional behavior changes occur. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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.
🧹 Nitpick comments (1)
FarmlandDropsWithNutrients/FDWNCore.cs (1)
33-50: Consider a small regression test for log semantics inAssetsFinalize.Given the explicit log-level intent in this PR, a lightweight test around the server-side path would help prevent future reintroduction of
Warningcalls.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@FarmlandDropsWithNutrients/FDWNCore.cs` around lines 33 - 50, Add a small regression test that invokes AssetsFinalize(ICoreAPI) on the server-side path (mock ICoreAPI with Side.IsServer() true) and asserts the logger emits Event-level entries (not Warning) for items where IsAcceptableFarmland() is true; specifically exercise AssetsFinalize so it hits the loops that call Logger.Event and AddBehavior (targeting FarmlandWithNutrientsBehavior and KeepNutrientsBehavior) and capture/inspect logged records to confirm they are Event-level and contain the collectible/block.Code values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@FarmlandDropsWithNutrients/FDWNCore.cs`:
- Around line 33-50: Add a small regression test that invokes
AssetsFinalize(ICoreAPI) on the server-side path (mock ICoreAPI with
Side.IsServer() true) and asserts the logger emits Event-level entries (not
Warning) for items where IsAcceptableFarmland() is true; specifically exercise
AssetsFinalize so it hits the loops that call Logger.Event and AddBehavior
(targeting FarmlandWithNutrientsBehavior and KeepNutrientsBehavior) and
capture/inspect logged records to confirm they are Event-level and contain the
collectible/block.Code values.
In the Server Log, the messages for adding behavior are appearing as server warnings.
Code is not tested
Summary by CodeRabbit