Add some basic logging

This commit is contained in:
2021-12-22 12:52:23 -05:00
parent a0eb5e3fbc
commit a98f87a630
3 changed files with 31 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
using Common.Helpers;
using Common.IO;
using Common.Wpf.Extensions;
using Serilog;
using Squirrel;
using System;
using System.Reflection;
@@ -25,6 +26,13 @@ namespace WorkIndicator
{
SquirrelAwareApp.HandleEvents(onAppUpdate: version => Common.Settings.Extensions.RestoreSettings());
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File("log.txt", rollingInterval: RollingInterval.Day)
.CreateLogger();
Log.Logger.Debug($"Startup");
var application = new App();
application.InitializeComponent();
application.Run();
@@ -90,6 +98,8 @@ namespace WorkIndicator
protected override void OnExit(ExitEventArgs e)
{
Log.Logger.Debug($"Exit");
// Get rid of the light controller
LightController.Dispose();