GoldbergGUI/GoldbergGUI.WPF/Setup.cs
Jeddunk a34ed8881d version 0.1.0
Added COPYING and README.md
Implemented Serilog
2021-01-14 19:38:31 +01:00

27 lines
822 B
C#

using System;
using System.IO;
using System.Windows.Controls;
using System.Windows.Threading;
using MvvmCross.Logging;
using MvvmCross.Platforms.Wpf.Core;
using Serilog;
namespace GoldbergGUI.WPF
{
public class Setup : MvxWpfSetup<Core.App>
{
public override MvxLogProviderType GetDefaultLogProviderType() => MvxLogProviderType.Serilog;
protected override IMvxLogProvider CreateLogProvider()
{
var logPath = Path.Combine(Directory.GetCurrentDirectory(),"goldberg_.log");
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File(logPath, rollingInterval: RollingInterval.Day)
.CreateLogger();
return base.CreateLogProvider();
}
}
}