Skip to content

Commit 9dda254

Browse files
authored
Documentation updates
1 parent 72bc8de commit 9dda254

File tree

3 files changed

+13
-85
lines changed

3 files changed

+13
-85
lines changed

CHANGES.md

Lines changed: 6 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,13 @@
1-
## Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.0.0
1+
## Release Notes - Serilog.Sinks.RichTextBox.WinForms.Colored v3.0.1
22

3-
### Major Release - Breaking Changes
3+
### Minor Release
44

5-
This major release focuses on performance optimization, UI stability, and streamlined configuration while simplifying the configuration API.
5+
This minor release focuses on config improvements and performance optimization.
66

7-
### Breaking Changes
7+
### What Changed
88

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
9+
- Adjusted MaxLogLines limit From 512 to 2048 lines.
10+
- Optimized the Concurrent Circular Buffer
7911

8012
### Resources
8113

Serilog.Sinks.RichTextBox.WinForms.Colored/Serilog.Sinks.RichTextBox.WinForms.Colored.csproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222
<TargetFrameworks>net462;net471;net6.0-windows;net8.0-windows;net9.0-windows;netcoreapp3.0-windows;netcoreapp3.1-windows</TargetFrameworks>
2323
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2424
<UseWindowsForms>true</UseWindowsForms>
25-
<Version>3.0.0</Version>
25+
<Version>3.0.1</Version>
2626
<PackageReleaseNotes>
27-
- Reduced configurable options to only the most relevant ones (breaking change).
28-
- Aligned theme colors with Serilog WPF sink including WCAG compliance (breaking change).
29-
- Fixed UI freeze caused by SystemEvents on background-thread RichTextBox.
30-
- Optimized performance by removing the off-screen RichTextBox and improving rendering logic.
31-
- Fixed auto-scroll issue on .NET Framework.
27+
- Adjusted MaxLogLines constraint from 512 to 2048 lines.
28+
- Minor improvements to the concurrent circular buffer.
3229

3330
See repository for more information:
3431
https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored

Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Collections/ConcurrentCircularBuffer.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ namespace Serilog.Sinks.RichTextBoxForms.Collections
44
{
55
internal sealed class ConcurrentCircularBuffer<T>
66
{
7+
private readonly object _sync = new();
78
private readonly T[] _buffer;
89
private readonly int _capacity;
910
private int _head;
1011
private int _count;
1112

12-
private readonly object _sync = new();
13-
1413
public ConcurrentCircularBuffer(int capacity)
1514
{
1615
_capacity = capacity > 0 ? capacity : 1;
@@ -21,7 +20,7 @@ public void Add(T item)
2120
{
2221
lock (_sync)
2322
{
24-
int tail = _head + _count;
23+
var tail = _head + _count;
2524
if (tail >= _capacity)
2625
{
2726
tail -= _capacity;
@@ -49,9 +48,9 @@ public void TakeSnapshot(List<T> target)
4948
{
5049
target.Clear();
5150

52-
for (int i = 0; i < _count; ++i)
51+
for (var i = 0; i < _count; ++i)
5352
{
54-
int index = _head + i;
53+
var index = _head + i;
5554
if (index >= _capacity)
5655
{
5756
index -= _capacity;

0 commit comments

Comments
 (0)