Refactor/logs#40
Conversation
IvanMurzak
commented
Dec 16, 2025
- Replaced StringBuilder usage with Logs class for logging messages in various reflection converters.
- Updated method signatures across multiple files to accept Logs instead of StringBuilder.
- Enhanced log messages for success, error, and warning scenarios to improve clarity and consistency.
- Adjusted Print utility methods to utilize the new logging approach, ensuring better integration with the overall logging framework.
…N utility for unstringifying JSON
- Replaced StringBuilder usage with Logs class for logging messages in various reflection converters. - Updated method signatures across multiple files to accept Logs instead of StringBuilder. - Enhanced log messages for success, error, and warning scenarios to improve clarity and consistency. - Adjusted Print utility methods to utilize the new logging approach, ensuring better integration with the overall logging framework.
Test Results 3 files 3 suites 2m 53s ⏱️ Results for commit 0abd65d. ♻️ This comment has been updated with latest results. |
… for serialization
There was a problem hiding this comment.
Pull request overview
This PR refactors the logging infrastructure throughout the ReflectorNet codebase by replacing StringBuilder with a new Logs class for structured logging. This improves type safety, consistency, and provides better support for hierarchical log formatting with depth-based indentation.
Key Changes:
- Introduced a new
Logsclass with extension methods for different log levels (Trace, Debug, Info, Success, Warning, Error, Critical) - Replaced
StringBuilder? stringBuilderparameters withLogs? logsacross all reflection converters and core components - Enhanced log message formatting to leverage the new structured logging approach
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| ReflectorNet/src/Model/Logs.cs | New file introducing the Logs class, LogEntry, LogType enum, and extension methods for structured logging |
| ReflectorNet.Tests/src/Model/LogsTests.cs | Comprehensive test coverage for the new Logs class functionality |
| ReflectorNet/src/Utils/Print/Print.cs | Updated utility methods to use Logs instead of StringBuilder, simplified error reporting logic |
| ReflectorNet/src/Utils/Json/JsonUtils.cs | New utility file for JSON operations (contains commented-out experimental code) |
| ReflectorNet/src/Reflector/Reflector.cs | Updated method signatures to use Logs parameter for Serialize/Deserialize operations |
| ReflectorNet/src/Reflector/Reflector.Populate.cs | Updated TryPopulate to use Logs for error reporting |
| ReflectorNet/src/Extension/ExtensionsJsonElement.cs | Updated extension methods to use Logs parameter |
| ReflectorNet/src/Converter/Reflection/Specialized/TypeReflectionConverter.cs | Updated converter to use Logs in serialization/deserialization |
| ReflectorNet/src/Converter/Reflection/Specialized/AssemblyReflectionConverter.cs | Updated converter to use Logs in serialization/deserialization |
| ReflectorNet/src/Converter/Reflection/PrimitiveReflectionConverter.cs | Updated to use Logs for field/property modification logging |
| ReflectorNet/src/Converter/Reflection/GenericReflectionConverter.cs | Updated to use Logs with null-conditional operator pattern |
| ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Serialize.cs | Updated base serialization methods to accept Logs parameter |
| ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs | Updated population logic to use Logs, contains syntax errors in multi-line string concatenation |
| ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Deserialize.cs | Updated deserialization to use Logs for error/warning messages |
| ReflectorNet/src/Converter/Reflection/ArrayReflectionConverter.cs | Updated array converter to use Logs for serialization/deserialization |
| ReflectorNet/src/Converter/Reflection/ArrayReflectionConverter.Deserialize.cs | Updated array deserialization to use Logs throughout |
| ReflectorNet/src/Converter/IReflectionConverter.cs | Updated interface to reflect Logs parameter in all method signatures |
| ReflectorNet.Tests/src/SchemaTests/ErrorHandlingTests.cs | Updated tests to use new Logs class instead of StringBuilder |
| ReflectorNet.Tests/src/ReflectorTests/SerializePopulateTests.cs | Updated tests to instantiate Logs instead of StringBuilder |
| ReflectorNet.Tests/src/ReflectorTests/SerializationTests.cs | Updated serialization tests to use Logs with proper instantiation pattern |
| README.md | Updated documentation example to show Logs parameter usage |
| .vscode/settings.json | Added spell check entries for logging-related abbreviations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oved readability and consistency