Releases: vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored
v3.2.0
Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.2.0
What Changed
- Added support for json pretty printing.
Resources
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
ArgumentOutOfRangeExceptionthrown 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.InvalidOperationExceptiondue 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
messageBatchSizeparameter (no longer needed) - Removed
messagePendingIntervalparameter (no longer needed) - Renamed
appliedThemeparameter tothemefor 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
maxLogLinesparameter 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:
DarkorDarkClassic→ThemePresets.ColoredorThemePresets.GrayscaleorThemePresets.LiterateLightorLightClassic→ThemePresets.Luminous
-
Update Parameter Names:
appliedTheme→theme- Remove
messageBatchSizeandmessagePendingIntervalparameters (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
appliedThemeparameter totheme(breaking change) - Removed
messageBatchSizeandmessagePendingIntervalparameters (breaking change) - Completely redesigned theme system with new theme names and WCAG compliance (breaking change)
- Added new
Luminoustheme for high contrast accessibility - Enhanced
maxLogLinesvalidation 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