BufferingTargetWrapper - Improve InternalLogger output when WrappedTarget is NULL#6062
BufferingTargetWrapper - Improve InternalLogger output when WrappedTarget is NULL#6062
Conversation
WalkthroughTwo logging wrapper classes have been updated to downgrade the severity of null WrappedTarget conditions from Error to Debug level and adjust the corresponding log message to indicate missing output. No control flow modifications. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/NLog/Targets/Wrappers/BufferingTargetWrapper.cs (1)
317-321: Downgrading NULL WrappedTarget to Debug looks reasonable; consider optionally includingreasonfor diagnosis.
The updated message is clearer (“no output”) and Debug reduces internal-log noise for wrapper lifecycles. If you want a bit more forensic value when Debug is enabled, consider appending thereason(when non-empty) to the message.src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs (1)
561-565: Consistent, lower-noise internal logging for NULL WrappedTarget; message improvement is good.
The Debug-level log plus “No output…” wording better reflects the outcome without implying a runtime failure. (Optional) includereasonto help correlate where/why the flush happened when Debug is enabled.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs(1 hunks)src/NLog/Targets/Wrappers/BufferingTargetWrapper.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs (3)
src/NLog/Common/InternalLogger.cs (1)
InternalLogger(51-511)src/NLog/Logger-generated.cs (5)
Debug(403-409)Debug(417-423)Debug(429-436)Debug(457-463)Debug(515-521)src/NLog/Config/InstallationContext.cs (1)
Debug(121-124)
src/NLog/Targets/Wrappers/BufferingTargetWrapper.cs (1)
src/NLog/Common/InternalLogger.cs (1)
InternalLogger(51-511)
|



NLog already alerts when initialization fails, no need to repeat the same error over and over.