Init global logger from Serilog to file on Error level

pull/96/head
stevealexandre 2 years ago
parent 142e6529e7
commit 266dab93b9

@ -1,4 +1,5 @@
using Force.Crc32; using Force.Crc32;
using Serilog;
using SharpSteam; using SharpSteam;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -35,6 +36,10 @@ namespace UWPHook
Debug.WriteLine("Init GamesWindow"); Debug.WriteLine("Init GamesWindow");
Apps = new AppEntryModel(); Apps = new AppEntryModel();
var args = Environment.GetCommandLineArgs(); 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 null or 1, the app was launched normally
if (args?.Length > 1) if (args?.Length > 1)
@ -400,7 +405,7 @@ namespace UWPHook
AppName = app.Name, AppName = app.Name,
Exe = exePath, Exe = exePath,
StartDir = exeDir, StartDir = exeDir,
LaunchOptions = app.Aumid, LaunchOptions = app.Aumid + " " + app.Executable,
AllowDesktopConfig = 1, AllowDesktopConfig = 1,
AllowOverlay = 1, AllowOverlay = 1,
Icon = icon, Icon = icon,
@ -667,7 +672,7 @@ namespace UWPHook
string logosPath = Path.GetDirectoryName(values[1]); string logosPath = Path.GetDirectoryName(values[1]);
Application.Current.Dispatcher.BeginInvoke((Action)delegate () 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 });
}); });
} }
} }

Loading…
Cancel
Save