github.com/anchore/syft@v1.38.2/syft/pkg/cataloger/dotnet/test-fixtures/image-net2-app/src/Program.cs (about)

     1  using System;
     2  using Serilog;
     3  
     4  namespace HelloWorld
     5  {
     6      /// <summary>
     7      /// Main program class!
     8      /// </summary>
     9      public class Program
    10      {
    11          /// <summary>
    12          /// Entry point for the application!
    13          /// </summary>
    14          /// <param name="args">Command line arguments!</param>
    15          public static void Main(string[] args)
    16          {
    17              // configure Serilog
    18              Log.Logger = new LoggerConfiguration()
    19                  .MinimumLevel.Information()
    20                  .WriteTo.Console()
    21                  .CreateLogger();
    22  
    23              try
    24              {
    25                  Log.Information("Starting up the application");
    26                  Console.WriteLine("Hello World!");
    27                  Log.Information("Application completed successfully");
    28              }
    29              catch (Exception ex)
    30              {
    31                  Log.Fatal(ex, "Application terminated unexpectedly");
    32              }
    33              finally
    34              {
    35                  Log.CloseAndFlush();
    36              }
    37  
    38              Console.WriteLine("Press any key to exit...");
    39              Console.ReadKey();
    40          }
    41      }
    42  }