Conversation
* Update to version 1.1.1 with log level padding - Added consistent padding for log level field in logs. - Introduced unit test `Logger_LogLevel_Padding_Is_Consistent` to verify padding. - Modified log formatting in `Logging.cs` to ensure 5-character width for log levels. - Updated `AssemblyInfo.cs` to version 1.1.1. * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the project to version 1.1.1 by adding consistent padding to log level fields in the logging output. The change ensures all log levels display with a uniform 5-character width for better formatting alignment.
- Added padding to log level field formatting to maintain consistent width
- Introduced comprehensive unit test to verify log level padding behavior
- Updated version number to 1.1.1 across assembly info and changelog
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| SerpentModding/Properties/AssemblyInfo.cs | Updated assembly version from 1.1.0 to 1.1.1 |
| SerpentModding/Logging.cs | Modified log formatting to pad log levels to 5 characters using PadRight() |
| SerpentModding.Tests/UnitTest.cs | Added unit test to verify consistent 5-character padding for all log levels |
| CHANGELOG.md | Added changelog entry documenting the log level padding feature |
| if (start > 0 && end > start && line.Length > end + 1 && line[end + 1] == ' ' && line[start - 1] == '[') | ||
| { | ||
| var maybeLevel = line.Substring(start, end - start); | ||
| if (new[] { "TRACE", "DEBUG", "INFO ", "WARN ", "ERROR", "FATAL" }.Contains(maybeLevel)) |
There was a problem hiding this comment.
The array contains inconsistent padding with "INFO " and "WARN " having trailing spaces while others don't. This should be consistent - either all should have trailing spaces for 5-character width or use the actual padded values from PadRight(5).
|



Logger_LogLevel_Padding_Is_Consistentto verify padding.Logging.csto ensure 5-character width for log levels.AssemblyInfo.csto version 1.1.1.Apply suggestions from code review
Update CHANGELOG.md