39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Serilog;
|
|
|
|
namespace AirBomber
|
|
{
|
|
internal static class Program
|
|
{
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
Log.Logger = new LoggerConfiguration()
|
|
.MinimumLevel.Debug()
|
|
.WriteTo.File("airbomberlog-.log", rollingInterval: RollingInterval.Day)
|
|
.CreateLogger();
|
|
|
|
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);
|
|
option.AddSerilog();
|
|
}
|
|
);
|
|
}
|
|
}
|
|
} |