From 266dab93b9493b346fcf7ed7031180a5370c5b8b Mon Sep 17 00:00:00 2001 From: stevealexandre Date: Thu, 8 Sep 2022 02:35:25 +0200 Subject: [PATCH] Init global logger from Serilog to file on Error level --- UWPHook/GamesWindow.xaml.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UWPHook/GamesWindow.xaml.cs b/UWPHook/GamesWindow.xaml.cs index 9043b43..ba1501a 100644 --- a/UWPHook/GamesWindow.xaml.cs +++ b/UWPHook/GamesWindow.xaml.cs @@ -1,4 +1,5 @@ using Force.Crc32; +using Serilog; using SharpSteam; using System; using System.Collections.Generic; @@ -35,6 +36,10 @@ namespace UWPHook Debug.WriteLine("Init GamesWindow"); Apps = new AppEntryModel(); var args = Environment.GetCommandLineArgs(); + Log.Logger = new LoggerConfiguration() + .MinimumLevel.Error() + .WriteTo.File("debug.log", rollingInterval: RollingInterval.Day) + .CreateLogger(); // If null or 1, the app was launched normally if (args?.Length > 1) @@ -400,7 +405,7 @@ namespace UWPHook AppName = app.Name, Exe = exePath, StartDir = exeDir, - LaunchOptions = app.Aumid, + LaunchOptions = app.Aumid + " " + app.Executable, AllowDesktopConfig = 1, AllowOverlay = 1, Icon = icon, @@ -667,7 +672,7 @@ namespace UWPHook string logosPath = Path.GetDirectoryName(values[1]); Application.Current.Dispatcher.BeginInvoke((Action)delegate () { - Apps.Entries.Add(new AppEntry() { Name = values[0], IconPath = logosPath, Aumid = values[2], Selected = false }); + Apps.Entries.Add(new AppEntry() { Name = values[0], Executable = values[3], IconPath = logosPath, Aumid = values[2], Selected = false }); }); } }