39 lines
1.1 KiB
C#
Raw Permalink Normal View History

2023-11-26 00:26:38 +04:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
2023-11-26 01:11:09 +04:00
using Serilog;
2023-11-26 00:26:38 +04:00
2023-11-18 22:09:52 +04:00
namespace AirBomber
{
internal static class Program
{
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
2023-11-26 00:26:38 +04:00
2023-11-26 01:11:09 +04:00
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File("airbomberlog-.log", rollingInterval: RollingInterval.Day)
.CreateLogger();
2023-11-26 00:26:38 +04:00
var services = new ServiceCollection();
ConfigureServices(services);
using (ServiceProvider ServiceProvider = services.BuildServiceProvider())
{
Application.Run(ServiceProvider.GetRequiredService<FormEntityCollection>());
}
}
private static void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<FormEntityCollection>().AddLogging(
option =>
{
option.SetMinimumLevel(LogLevel.Information);
2023-11-26 01:11:09 +04:00
option.AddSerilog();
2023-11-26 00:26:38 +04:00
}
);
2023-11-18 22:09:52 +04:00
}
}
}