Skip to content

Replaced Warn with Event for Log Messages#1

Open
Niemand333 wants to merge 1 commit intojayugg:masterfrom
Niemand333:master
Open

Replaced Warn with Event for Log Messages#1
Niemand333 wants to merge 1 commit intojayugg:masterfrom
Niemand333:master

Conversation

@Niemand333
Copy link
Copy Markdown

@Niemand333 Niemand333 commented Mar 2, 2026

In the Server Log, the messages for adding behavior are appearing as server warnings.
Code is not tested

Summary by CodeRabbit

  • Chores
    • Updated internal logging calls during asset finalization to use event-based logging instead of warning-level logging, improving diagnostic tracking consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

Two 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

Cohort / File(s) Summary
Logging Call Updates
FarmlandDropsWithNutrients/FDWNCore.cs
Replaced two Logger.Warning(...) calls with Logger.Event(...) for collectibles and blocks logging in AssetsFinalize method; added trailing newline.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A logging hop so small and neat,
Events now sing, warnings retreat,
FDWNCore hops with glee,
Collectibles dance merrily,
Blocks align in harmony!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately reflects the main change: replacing Logger.Warning calls with Logger.Event calls for log messages in the AssetsFinalize method.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
FarmlandDropsWithNutrients/FDWNCore.cs (1)

33-50: Consider a small regression test for log semantics in AssetsFinalize.

Given the explicit log-level intent in this PR, a lightweight test around the server-side path would help prevent future reintroduction of Warning calls.

🤖 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.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3e015c and e07c23e.

📒 Files selected for processing (1)
  • FarmlandDropsWithNutrients/FDWNCore.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant