2022-05-12 15:40:28 -04:00
|
|
|
using Microsoft.Extensions.Logging;
|
2021-01-14 13:38:31 -05:00
|
|
|
using MvvmCross.Platforms.Wpf.Core;
|
|
|
|
using Serilog;
|
2022-05-12 15:40:28 -04:00
|
|
|
using Serilog.Extensions.Logging;
|
2021-12-22 07:15:28 -05:00
|
|
|
using System.IO;
|
2021-01-14 13:38:31 -05:00
|
|
|
|
|
|
|
namespace GoldbergGUI.WPF
|
|
|
|
{
|
|
|
|
public class Setup : MvxWpfSetup<Core.App>
|
|
|
|
{
|
2022-05-12 15:40:28 -04:00
|
|
|
protected override ILoggerProvider CreateLogProvider()
|
|
|
|
{
|
|
|
|
return new SerilogLoggerProvider();
|
|
|
|
}
|
|
|
|
protected override ILoggerFactory CreateLogFactory()
|
2021-01-14 13:38:31 -05:00
|
|
|
{
|
2021-12-22 07:15:28 -05:00
|
|
|
var logPath = Path.Combine(Directory.GetCurrentDirectory(), "goldberg_.log");
|
2021-01-14 13:38:31 -05:00
|
|
|
Log.Logger = new LoggerConfiguration()
|
|
|
|
.MinimumLevel.Debug()
|
|
|
|
.WriteTo.Console()
|
|
|
|
.WriteTo.File(logPath, rollingInterval: RollingInterval.Day)
|
|
|
|
.CreateLogger();
|
2022-05-12 15:40:28 -04:00
|
|
|
return new SerilogLoggerFactory();
|
2021-01-14 13:38:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|