You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor renderer constructors to use options object
Refactored all token renderer and TemplateRenderer constructors to accept a RichTextBoxSinkOptions object instead of individual parameters. Updated tests and extension methods accordingly. Standardized default JSON indentation to 2 spaces and removed unused parameters for consistency.
A [Serilog](https://github.com/serilog/serilog) sink that writes log events to
9
-
a [WinForms RichTextBox](https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/richtextbox-control-overview-windows-forms)
10
-
with support for coloring and custom themes.
8
+
A [Serilog](https://github.com/serilog/serilog) sink that writes log events to a [WinForms RichTextBox](https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/richtextbox-control-overview-windows-forms) with support for coloring and custom themes.
11
9
12
10

13
11
@@ -18,8 +16,7 @@ with support for coloring and custom themes.
18
16
- High-performance asynchronous processing
19
17
- Line limit to control memory usage
20
18
- Support for pretty-printing of JSON objects
21
-
- WCAG compliant color schemes based on
22
-
the [Serilog WPF RichTextBox](https://github.com/serilog-contrib/serilog-sinks-richtextbox) sink.
19
+
- WCAG compliant color schemes based on the [Serilog WPF RichTextBox](https://github.com/serilog-contrib/serilog-sinks-richtextbox) sink.
23
20
24
21
## Getting Started
25
22
@@ -54,20 +51,19 @@ Log.Logger = new LoggerConfiguration()
54
51
Log.Information("Hello, world!");
55
52
```
56
53
57
-
See the [Extension Method](Serilog.Sinks.RichTextBox.WinForms.Colored/RichTextBoxSinkLoggerConfigurationExtensions.cs)
58
-
for more configuration options.
54
+
See the [Extension Method](Serilog.Sinks.RichTextBox.WinForms.Colored/RichTextBoxSinkLoggerConfigurationExtensions.cs) for more configuration options.
|`theme`| The color theme applied when rendering individual message tokens. |`ThemePresets.Literate`|
65
-
|`autoScroll`| When `true` (default) the target control scrolls automatically to the most recent log line. |`true`|
66
-
|`maxLogLines`| Maximum number of log events retained in the in-memory circular buffer and rendered in the control. |`256`|
67
-
|`outputTemplate`| Serilog output template that controls textual formatting of each log event. |`[${Timestamp:HH:mm:ss} ${Level:u3}] ${Message:lj}${NewLine}${Exception}`|
68
-
|`formatProvider`| Optional culture-specific or custom formatting provider used when rendering scalar values; `null` for the invariant culture. |`CultureInfo.InvariantCulture`|
69
-
|`prettyPrintJson`| When `true`, formats JSON values with indentation and line breaks for better readability. |`false`|
70
-
|`spacesPerIndent`| Number of spaces per indentation level when pretty printing JSON. |`2`|
|`theme`| The color theme applied when rendering individual message tokens. |`ThemePresets.Literate`|
61
+
|`autoScroll`| When `true` (default) the target control scrolls automatically to the most recent log line. |`true`|
62
+
|`maxLogLines`| Maximum number of log events retained in the in-memory circular buffer and rendered in the control. |`256`|
63
+
|`outputTemplate`| Serilog output template that controls textual formatting of each log event. |`[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}`|
64
+
|`formatProvider`| Optional culture-specific or custom formatting provider used when rendering scalar values; `null` for the invariant culture. |`CultureInfo.InvariantCulture`|
65
+
|`prettyPrintJson`| When `true`, formats JSON values with indentation and line breaks for better readability. |`false`|
66
+
|`spacesPerIndent`| Number of spaces per indentation level when pretty printing JSON. |`2`|
71
67
72
68
## Themes
73
69
@@ -80,21 +76,13 @@ Available built-in themes:
80
76
|`ThemePresets.Colored`| A theme based on the original Serilog.Sinks.ColoredConsole sink |
81
77
|`ThemePresets.Luminous`| A light theme with high contrast for accessibility |
82
78
83
-
The themes based on the original sinks are slightly adjusted to
84
-
be [WCAG compliant](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum), ensuring that the contrast ratio
85
-
between text and background colors is at least 4.5:1.
79
+
The themes based on the original sinks are slightly adjusted to be [WCAG compliant](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum), ensuring that the contrast ratio between text and background colors is at least 4.5:1.
86
80
87
-
You can create your own custom themes by creating a new instance of
88
-
the [Theme](Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Themes/Theme.cs) class and passing it to
89
-
the `RichTextBox` extension method. Look at
90
-
the [existing themes](Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Themes/ThemePresets.cs) for
91
-
examples.
81
+
You can create your own custom themes by creating a new instance of the [Theme](Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Themes/Theme.cs) class and passing it to the `RichTextBox` extension method. Look at the [existing themes](Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Themes/ThemePresets.cs) for examples.
92
82
93
83
## Support the Project 💖
94
84
95
-
This project has been maintained since 2022 and is still under active development. If you find it useful, please
96
-
consider supporting it. Your support will help keep the project alive and allow me to dedicate more time to making
97
-
improvements. You can support it through:
85
+
This project has been maintained since 2022 and is still under active development. If you find it useful, please consider supporting it. Your support will help keep the project alive and allow me to dedicate more time to making improvements. You can support it through:
0 commit comments