Skip to content

Commit

Permalink
Complete Missing DeveloperMode Option
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Nov 8, 2023
1 parent f419162 commit a59caf6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions dev/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,19 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)

rootFrame.Navigate(typeof(MainPage));

if (Settings.UseDeveloperMode)
{
ConfigureLogger();
}
UnhandledException += App_UnhandledException;

currentWindow.Title = currentWindow.AppWindow.Title = $"AlAnvar v{AppVersion}";
currentWindow.AppWindow.SetIcon("Assets/icon.ico");
currentWindow.Activate();
}

private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
{
Logger?.Error(e.Exception, "UnhandledException");
}
}
1 change: 1 addition & 0 deletions dev/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@

global using static AlAnvar.Helpers.AlAnvarHelper;
global using static AlAnvar.Helpers.Constants;
global using static AlAnvar.Helpers.LoggerSetup;
5 changes: 2 additions & 3 deletions dev/Helpers/LoggerSetup.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using AlAnvar.Helpers;
using Serilog;
using Serilog;

namespace AlAnvar.Common;
namespace AlAnvar.Helpers;
public static class LoggerSetup
{
public static ILogger Logger { get; private set; }
Expand Down

0 comments on commit a59caf6

Please sign in to comment.