|
| 1 | +## Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.0.0 |
| 2 | + |
| 3 | +### Major Release - Breaking Changes |
| 4 | + |
| 5 | +This major release focuses on performance optimization, UI stability, and streamlined configuration while simplifying the configuration API. |
| 6 | + |
| 7 | +### Breaking Changes |
| 8 | + |
| 9 | +- **Simplified Configuration Options**: Reduced configurable options to focus only on the most relevant and commonly used settings: |
| 10 | + - Removed `messageBatchSize` parameter (no longer needed) |
| 11 | + - Removed `messagePendingInterval` parameter (no longer needed) |
| 12 | + - Renamed `appliedTheme` parameter to `theme` for consistency |
| 13 | + |
| 14 | +- **Theme System Overhaul**: Complete redesign of the theme system to align with the Serilog WPF sink. Previous theme names (`Dark`, `Light`, `DarkClassic`, `LightClassic`) have been replaced with new theme presets. All themes now include WCAG compliance with proper contrast ratio. |
| 15 | + |
| 16 | +- **Enhanced Memory Management**: The `maxLogLines` parameter now has improved validation (1-512 range) with a default of 256 lines to ensure optimal performance. While not mandatory, proper configuration is recommended to prevent performance degradation from excessive log entries in the WinForms control. |
| 17 | + |
| 18 | +### New Theme System |
| 19 | + |
| 20 | +Available built-in themes: |
| 21 | + |
| 22 | +| Theme | Description | |
| 23 | +|-----------------------------|------------------------------------------------------------------------------| |
| 24 | +| `ThemePresets.Literate` | Styled to replicate the default theme of Serilog.Sinks.Console (default) | |
| 25 | +| `ThemePresets.Grayscale` | A theme using only shades of gray, white, and black | |
| 26 | +| `ThemePresets.Colored` | A theme based on the original Serilog.Sinks.ColoredConsole sink | |
| 27 | +| `ThemePresets.Luminous` | A new light theme with high contrast for accessibility | |
| 28 | + |
| 29 | +The themes based on the original sinks are slightly adjusted to be WCAG compliant, ensuring that the contrast ratio between text and background colors is at least 4.5:1. `Luminous` is a new theme specifically created for this sink. |
| 30 | + |
| 31 | +### Bug Fixes |
| 32 | + |
| 33 | +- **Fixed UI Freezing**: Resolved critical UI freeze issues caused by SystemEvents when using RichTextBox controls on background threads. |
| 34 | + |
| 35 | +- **Fixed Auto-scroll on .NET Framework**: Corrected auto-scroll behavior that wasn't working properly on .NET Framework applications. |
| 36 | + |
| 37 | +### Performance Improvements |
| 38 | + |
| 39 | +- **Optimized Rendering Logic**: Removed the off-screen RichTextBox dependency and improved the rendering pipeline for better performance and reduced memory usage. |
| 40 | + |
| 41 | +- **Streamlined Processing**: Removed unnecessary batching parameters to simplify internal processing logic. |
| 42 | + |
| 43 | +### Migration Guide |
| 44 | + |
| 45 | +Due to breaking changes, please update your existing configurations: |
| 46 | + |
| 47 | +1. **Update Theme Names**: Replace old theme names with new equivalents: |
| 48 | + - `Dark` or `DarkClassic` → `ThemePresets.Colored` or `ThemePresets.Grayscale` or `ThemePresets.Literate` |
| 49 | + - `Light` or `LightClassic` → `ThemePresets.Luminous` |
| 50 | + |
| 51 | +2. **Update Parameter Names**: |
| 52 | + - `appliedTheme` → `theme` |
| 53 | + - Remove `messageBatchSize` and `messagePendingInterval` parameters (no longer supported) |
| 54 | + |
| 55 | +I recommend pairing this sink with a file sink for persistent logging storage, as it's not practical to have thousands of log entries displayed in a RichTextBox control. |
| 56 | + |
| 57 | +### Recommended Configuration |
| 58 | + |
| 59 | +```csharp |
| 60 | +Log.Logger = new LoggerConfiguration() |
| 61 | + .WriteTo.RichTextBox(richTextBox1, |
| 62 | + theme: ThemePresets.Literate, |
| 63 | + maxLogLines: 64) // Optional, defaults to 256 |
| 64 | + .WriteTo.File("logs/app-.txt", rollingInterval: RollingInterval.Day) // Recommended for persistence |
| 65 | + .CreateLogger(); |
| 66 | +``` |
| 67 | + |
| 68 | +### Full Changelog |
| 69 | + |
| 70 | +- Reduced configurable options to only the most relevant ones (breaking change) |
| 71 | +- Renamed `appliedTheme` parameter to `theme` (breaking change) |
| 72 | +- Removed `messageBatchSize` and `messagePendingInterval` parameters (breaking change) |
| 73 | +- Completely redesigned theme system with new theme names and WCAG compliance (breaking change) |
| 74 | +- Added new `Luminous` theme for high contrast accessibility |
| 75 | +- Enhanced `maxLogLines` validation with 1-512 range limit |
| 76 | +- Fixed UI freeze caused by SystemEvents on background-thread RichTextBox |
| 77 | +- Optimized performance by removing the off-screen RichTextBox and improving rendering logic |
| 78 | +- Fixed auto-scroll issue on .NET Framework |
| 79 | + |
| 80 | +### Resources |
| 81 | + |
| 82 | +- [GitHub Repository](https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored) |
| 83 | +- [NuGet Package](https://www.nuget.org/packages/Serilog.Sinks.RichTextBox.WinForms.Colored) |
0 commit comments