Skip to content

Refactor/logs#40

Merged
IvanMurzak merged 5 commits intomainfrom
refactor/logs
Dec 16, 2025
Merged

Refactor/logs#40
IvanMurzak merged 5 commits intomainfrom
refactor/logs

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

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

- 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.
@IvanMurzak IvanMurzak self-assigned this Dec 16, 2025
@IvanMurzak IvanMurzak added the enhancement New feature or request label Dec 16, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 16, 2025

Test Results

    3 files      3 suites   2m 53s ⏱️
  620 tests   620 ✅ 0 💤 0 ❌
1 822 runs  1 822 ✅ 0 💤 0 ❌

Results for commit 0abd65d.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Logs class with extension methods for different log levels (Trace, Debug, Info, Success, Warning, Error, Critical)
  • Replaced StringBuilder? stringBuilder parameters with Logs? logs across 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.

Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread .vscode/settings.json Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
Comment thread ReflectorNet/src/Converter/Reflection/Base/BaseReflectionConverter.Populate.cs Outdated
@IvanMurzak IvanMurzak merged commit 8a13913 into main Dec 16, 2025
1 check passed
@IvanMurzak IvanMurzak deleted the refactor/logs branch December 16, 2025 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants