Skip to content

Commit 03852f4

Browse files
committed
Update Serilog.Sinks.RichTextBox.WinForms.Colored.csproj
1 parent 9a1db27 commit 03852f4

File tree

2 files changed

+37
-23
lines changed

2 files changed

+37
-23
lines changed

README.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
[![Latest version](https://img.shields.io/nuget/v/Serilog.Sinks.RichTextBox.WinForms.Colored.svg)](https://www.nuget.org/packages/Serilog.Sinks.RichTextBox.WinForms.Colored)
66
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
77

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.
8+
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.
911

1012
![Screenshot of Serilog.Sinks.RichTextBox.WinForms.Colored in action](https://raw.githubusercontent.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored/master/screenshot.png)
1113

@@ -16,7 +18,8 @@ A [Serilog](https://github.com/serilog/serilog) sink that writes log events to a
1618
- High-performance asynchronous processing
1719
- Line limit to control memory usage
1820
- Support for pretty-printing of JSON objects
19-
- WCAG compliant color schemes based on the [Serilog WPF RichTextBox](https://github.com/serilog-contrib/serilog-sinks-richtextbox) sink.
21+
- WCAG compliant color schemes based on
22+
the [Serilog WPF RichTextBox](https://github.com/serilog-contrib/serilog-sinks-richtextbox) sink.
2023

2124
## Getting Started
2225

@@ -51,36 +54,47 @@ Log.Logger = new LoggerConfiguration()
5154
Log.Information("Hello, world!");
5255
```
5356

54-
See the [Extension Method](Serilog.Sinks.RichTextBox.WinForms.Colored/RichTextBoxSinkLoggerConfigurationExtensions.cs) for more configuration options.
57+
See the [Extension Method](Serilog.Sinks.RichTextBox.WinForms.Colored/RichTextBoxSinkLoggerConfigurationExtensions.cs)
58+
for more configuration options.
5559

56-
## Themes
57-
58-
Available built-in themes:
59-
60-
| Theme | Description |
61-
|-----------------------------|------------------------------------------------------------------------------|
62-
| `ThemePresets.Literate` | Styled to replicate the default theme of Serilog.Sinks.Console __(default)__ |
63-
| `ThemePresets.Grayscale` | A theme using only shades of gray, white, and black |
64-
| `ThemePresets.Colored` | A theme based on the original Serilog.Sinks.ColoredConsole sink |
65-
| `ThemePresets.Luminous` | A light theme with high contrast for accessibility |
60+
## Configuration Options
6661

67-
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.
62+
| Option | Description | Default Value |
63+
|-------------------|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
64+
| `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` |
6871

69-
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.
70-
71-
## FAQ
72+
## Themes
7273

73-
### Why is the package name so long?
74+
Available built-in themes:
7475

75-
Shorter alternatives were already reserved in NuGet. The descriptive name helps people find it more easily.
76+
| Theme | Description |
77+
|--------------------------|------------------------------------------------------------------------------|
78+
| `ThemePresets.Literate` | Styled to replicate the default theme of Serilog.Sinks.Console __(default)__ |
79+
| `ThemePresets.Grayscale` | A theme using only shades of gray, white, and black |
80+
| `ThemePresets.Colored` | A theme based on the original Serilog.Sinks.ColoredConsole sink |
81+
| `ThemePresets.Luminous` | A light theme with high contrast for accessibility |
7682

77-
### Why a WinForms RichTextBox and not WPF?
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.
7886

79-
This sink is designed for WinForms apps to avoid pulling in the WPF framework and its dependencies.
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.
8092

8193
## Support the Project 💖
8294

83-
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:
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:
8498

8599
* [GitHub Sponsors](https://github.com/sponsors/vonhoff)
86100
* [Ko-fi](https://ko-fi.com/vonhoff)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
See repository for more information:
3030
https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored
31-
</PackageReleaseNotes>
31+
</PackageReleaseNotes>
3232
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
3333
<SupportedOSPlatform>windows</SupportedOSPlatform>
3434
<NeutralLanguage>en-US</NeutralLanguage>

0 commit comments

Comments
 (0)