Add project files.

This commit is contained in:
2025-07-29 10:18:44 -06:00
commit 89a7805015
81 changed files with 9939 additions and 0 deletions

57
DatEmAll-CLI/Program.cs Normal file
View File

@@ -0,0 +1,57 @@
using System;
using System.Threading;
using Serilog;
using Serilog.Formatting.Display;
using Serilog.Sinks.LogEmAll;
namespace DatEmAll_CLI
{
/// <summary>
/// The Main Program Class.
/// </summary>
class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
/// <param name="args"></param>
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();
}
/// <summary>
/// Configure the logger.
/// </summary>
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();
}
}
}