using System.Threading;
using System.Threading.Tasks;
using Serilog;
using Serilog.Formatting.Display;
using Serilog.Sinks.LogEmAll;
namespace DeheadEmAll_CLI
{
///
/// The Main Program Class.
///
class Program
{
///
/// The Main entry point for the program.
///
static void Main(string[] args)
{
// Configure the Logger.
ConfigureSerilog();
// Create a new program object.
DeheadEmAll.DeheadEmAll DHEA = new DeheadEmAll.DeheadEmAll();
// Set the title.
DHEA.UpdateTitle();
// Print the version.
DHEA.PrintVersion();
// Load the options passed from the command line arguments.
DHEA.LoadOptionsFromCLI(args);
// Load the options passed from the default options file.
DHEA.LoadOptionsFromFile();
// Process the command switch.
DHEA.ProcessCommandSwitch();
// Output the log to a text file.
DHEA.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();
}
}
}