Skip to content

Commit a59caf6

Browse files
committed
Complete Missing DeveloperMode Option
1 parent f419162 commit a59caf6

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

dev/App.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,19 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
8080

8181
rootFrame.Navigate(typeof(MainPage));
8282

83+
if (Settings.UseDeveloperMode)
84+
{
85+
ConfigureLogger();
86+
}
87+
UnhandledException += App_UnhandledException;
88+
8389
currentWindow.Title = currentWindow.AppWindow.Title = $"AlAnvar v{AppVersion}";
8490
currentWindow.AppWindow.SetIcon("Assets/icon.ico");
8591
currentWindow.Activate();
8692
}
93+
94+
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
95+
{
96+
Logger?.Error(e.Exception, "UnhandledException");
97+
}
8798
}

dev/GlobalUsings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424

2525
global using static AlAnvar.Helpers.AlAnvarHelper;
2626
global using static AlAnvar.Helpers.Constants;
27+
global using static AlAnvar.Helpers.LoggerSetup;

dev/Helpers/LoggerSetup.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
using AlAnvar.Helpers;
2-
using Serilog;
1+
using Serilog;
32

4-
namespace AlAnvar.Common;
3+
namespace AlAnvar.Helpers;
54
public static class LoggerSetup
65
{
76
public static ILogger Logger { get; private set; }

0 commit comments

Comments
 (0)