using System; using System.Threading; using Serilog; using Serilog.Formatting.Display; using Serilog.Sinks.LogEmAll; namespace DatEmAll_CLI { /// /// The Main Program Class. /// class Program { /// /// The main entry point for the application. /// /// static void Main(string[] args) { // Configure the Logger. ConfigureSerilog(); // Create a new program object. DatEmAll.DatEmAll dea = new DatEmAll.DatEmAll(); // Set the title. dea.UpdateTitle(); // Print the version. dea.PrintVersion(); // Load the default options passed from the default options file. dea.LoadOptionsFromFile(); // Load the default options passed from the command line arguments. dea.LoadOptionsFromCLI(args); // Process the command switch. dea.ProcessCommandSwitch(); // Output the log to a text file. dea.SaveLogToFile(); } /// /// Configure the logger. /// public static void ConfigureSerilog() { Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() .WriteTo.Console(outputTemplate: "{Level:u4}: {Message:lj}{NewLine}{Exception}") .WriteToListString(new MessageTemplateTextFormatter("{Level:u4}: {Message:lj}{Exception}")) .CreateLogger(); } } }