Releases: vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored
v3.1.3
Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.1.3
What Changed
- Fixed performance issues when logging large numbers of complex messages that could cause application freezing.
- Fixed
ArgumentOutOfRangeException
thrown fromRtfBuilder.Clear()
Resources
v3.1.2
Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.1.2
What Changed
- Fixed a bug where cross-thread log messages during form construction caused
System.InvalidOperationException
due to premature access of the RichTextBox.
Contributors
Resources
v3.1.1
Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.1.1
What Changed
- Fixed a bug where the TextFormatter would crash when the value or format was null or empty.
Resources
v3.1.0
Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.1.0
Feature Release
This feature release introduces the ability to clear and restore the RichTextBox sink output.
What Changed
- Added
Clear()
andRestore()
operations to the circular buffer/RichTextBox sink.
Resources
v3.0.1
Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.0.1
Minor Release
This minor release focuses on config improvements and performance optimization.
What Changed
- Adjusted MaxLogLines limit From 512 to 2048 lines.
- Fixed a bug where the RichTextBox would not persist the zoom factor.
- Optimized the Concurrent Circular Buffer
Resources
v3.0.0
Serilog.Sinks.RichTextBox.WinForms.Colored v3.0.0
Major Release - Breaking Changes
This major release focuses on performance optimization, UI stability, and streamlined configuration while simplifying the configuration API.
Breaking Changes
-
Simplified Configuration Options: Reduced configurable options to focus only on the most relevant and commonly used settings:
- Removed
messageBatchSize
parameter (no longer needed) - Removed
messagePendingInterval
parameter (no longer needed) - Renamed
appliedTheme
parameter totheme
for consistency
- Removed
-
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. -
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.
New Theme System
Available built-in themes:
Theme | Description |
---|---|
ThemePresets.Literate |
Styled to replicate the default theme of Serilog.Sinks.Console (default) |
ThemePresets.Grayscale |
A theme using only shades of gray, white, and black |
ThemePresets.Colored |
A theme based on the original Serilog.Sinks.ColoredConsole sink |
ThemePresets.Luminous |
A new light theme with high contrast for accessibility |
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.
Bug Fixes
-
Fixed UI Freezing: Resolved critical UI freeze issues caused by SystemEvents when using RichTextBox controls on background threads.
-
Fixed Auto-scroll on .NET Framework: Corrected auto-scroll behavior that wasn't working properly on .NET Framework applications.
Performance Improvements
-
Optimized Rendering Logic: Removed the off-screen RichTextBox dependency and improved the rendering pipeline for better performance and reduced memory usage.
-
Streamlined Processing: Removed unnecessary batching parameters to simplify internal processing logic.
Migration Guide
Due to breaking changes, please update your existing configurations:
-
Update Theme Names: Replace old theme names with new equivalents:
Dark
orDarkClassic
→ThemePresets.Colored
orThemePresets.Grayscale
orThemePresets.Literate
Light
orLightClassic
→ThemePresets.Luminous
-
Update Parameter Names:
appliedTheme
→theme
- Remove
messageBatchSize
andmessagePendingInterval
parameters (no longer supported)
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.
Recommended Configuration
Log.Logger = new LoggerConfiguration()
.WriteTo.RichTextBox(richTextBox1,
theme: ThemePresets.Literate,
maxLogLines: 64) // Optional, defaults to 256
.WriteTo.File("logs/app-.txt", rollingInterval: RollingInterval.Day) // Recommended for persistence
.CreateLogger();
Full Changelog
- Reduced configurable options to only the most relevant ones (breaking change)
- Renamed
appliedTheme
parameter totheme
(breaking change) - Removed
messageBatchSize
andmessagePendingInterval
parameters (breaking change) - Completely redesigned theme system with new theme names and WCAG compliance (breaking change)
- Added new
Luminous
theme for high contrast accessibility - Enhanced
maxLogLines
validation with 1-512 range limit - Fixed UI freeze caused by SystemEvents on background-thread RichTextBox
- Optimized performance by removing the off-screen RichTextBox and improving rendering logic
- Fixed auto-scroll issue on .NET Framework
Resources
v2.1.2
v2.1.1
What's Changed
Public Changes:
- Replaced themes with newly designed themes.
- Moved old themes to "DarkClassic" and "LightClassic".
- Fixed bugs with the formatters (JSON and Literal).
- Changed the default configuration for optimal performance.
- Removed link detection, as it causes issues with the formatting.
- Updated TargetFrameworks to include net9.0-windows, netcoreapp3.1-windows, and netcoreapp3.0-windows.
Internal Changes:
- Added a lot of integration tests to reach at least 80% test coverage.
- Removed useless code and cleaned up the project.
- Replaced ConcurrentQueue with a BlockingCollection in the sink.
Full Changelog: v2.1.0...v2.1.1
v2.1.0
v2.0.0
What's changed
- Added support for .NET 8
- Added support for .NET Framework 4.5.2
- Added outputTemplate and formatProvider to options
Previous changes
- Added auto scroll property. by @vonhoff in #3
- Implement maximum log lines #5 by @dlampa in #6
- v1.2.1 Implement maximum log lines; by @vonhoff in #7
- Fix autoscrolling issue with line limit; by @dlampa in #9
- V1.2.2 by @vonhoff in #10
Contributors
- @vonhoff made their first contribution in #3
- @dlampa made their first contribution in #6
- @BatLine made their first contribution in #12
Full Changelog: https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored/commits/v2.0.0