File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,19 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
80
80
81
81
rootFrame . Navigate ( typeof ( MainPage ) ) ;
82
82
83
+ if ( Settings . UseDeveloperMode )
84
+ {
85
+ ConfigureLogger ( ) ;
86
+ }
87
+ UnhandledException += App_UnhandledException ;
88
+
83
89
currentWindow . Title = currentWindow . AppWindow . Title = $ "AlAnvar v{ AppVersion } ";
84
90
currentWindow . AppWindow . SetIcon ( "Assets/icon.ico" ) ;
85
91
currentWindow . Activate ( ) ;
86
92
}
93
+
94
+ private void App_UnhandledException ( object sender , Microsoft . UI . Xaml . UnhandledExceptionEventArgs e )
95
+ {
96
+ Logger ? . Error ( e . Exception , "UnhandledException" ) ;
97
+ }
87
98
}
Original file line number Diff line number Diff line change 24
24
25
25
global using static AlAnvar . Helpers . AlAnvarHelper ;
26
26
global using static AlAnvar . Helpers . Constants ;
27
+ global using static AlAnvar . Helpers . LoggerSetup ;
Original file line number Diff line number Diff line change 1
- using AlAnvar . Helpers ;
2
- using Serilog ;
1
+ using Serilog ;
3
2
4
- namespace AlAnvar . Common ;
3
+ namespace AlAnvar . Helpers ;
5
4
public static class LoggerSetup
6
5
{
7
6
public static ILogger Logger { get ; private set ; }
You can’t perform that action at this time.
0 commit comments