Skip to content

Commit

Permalink
Adds ReactiveUI logging into Serilog
Browse files Browse the repository at this point in the history
  • Loading branch information
ronelm2000 committed Oct 4, 2024
1 parent be7d8f9 commit ad9ec9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Montage.Weiss.Tools.GUI/Extensions/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Avalonia;
using Avalonia.Logging;
using Serilog;
using Splat;
using Splat.Serilog;

namespace Montage.Weiss.Tools.GUI.Extensions;
public static class AppBuilderExtensions
Expand All @@ -12,6 +14,8 @@ public static AppBuilder LogToSerilog(this AppBuilder builder)
.WriteTo.File("wsm-gui.log", Serilog.Events.LogEventLevel.Debug)
.CreateLogger();

Locator.CurrentMutable.UseSerilogFullLogger();

Logger.Sink = new SerilogLogSink();

return builder;
Expand Down
1 change: 1 addition & 0 deletions Montage.Weiss.Tools.GUI/Montage.Weiss.Tools.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<PackageReference Include="Avalonia.Xaml.Interactivity" Version="11.1.0.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="ReactiveUI" Version="20.1.63" />
<PackageReference Include="Splat.Serilog" Version="15.2.22" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ad9ec9e

Please sign in to comment.