Skip to content

Commit f495d23

Browse files
committed
refactor(ui): update TraceLog to configure RichTextBoxSink with dynamic theme and max log lines
1 parent 8765e1a commit f495d23

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

source/RevitDevTool/ViewModel/TraceLogViewModel.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using RevitDevTool.Theme;
99
using Serilog.Sinks.RichTextBoxForms;
1010
using Wpf.Ui.Appearance;
11-
using Serilog.Sinks.RichTextBoxForms.Themes;
1211

1312
namespace RevitDevTool.ViewModel;
1413

@@ -60,17 +59,11 @@ private void TraceStatus(bool isStarted)
6059

6160
private void Initialized()
6261
{
63-
var options = new RichTextBoxSinkOptions(
64-
theme: ThemePresets.Colored,
65-
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:l}{NewLine}{Exception}",
66-
formatProvider: CultureInfo.InvariantCulture);
67-
68-
_sink = new RichTextBoxSink(_winFormsTextBox, options);
69-
7062
var loggerConfig = new LoggerConfiguration()
7163
.MinimumLevel.ControlledBy(_levelSwitch)
7264
.WriteTo.RichTextBox(_winFormsTextBox,
7365
out _sink,
66+
maxLogLines: int.MaxValue,
7467
formatProvider: CultureInfo.InvariantCulture,
7568
theme: IsDarkTheme ? AdaptiveThemePresets.EnhancedDark : AdaptiveThemePresets.EnhancedLight,
7669
autoScroll: true);

0 commit comments

Comments
 (0)