using Serilog;
using Serilog.Enrichers.Span;

namespace WeatherForecast {

  /// <summary>
  /// 
  /// </summary>
  public class Program {

    /// <summary>
    /// 
    /// </summary>
    /// <param name="args"></param>
    public static void Main(string[] args) {
      CreateHostBuilder(args).Build().Run();
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="args"></param>
    /// <returns></returns>
    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .UseSerilog((hostContext, services, configuration) => {
              configuration.ReadFrom.Configuration(hostContext.Configuration)
              .Enrich.FromLogContext()
              .Enrich.WithSpan();
            })
            .ConfigureWebHostDefaults(webBuilder => {
              webBuilder.UseStartup<Startup>();
            });
  }
}
