DotBased/CLI/Program.cs

38 lines
952 B
C#
Raw Normal View History

2024-04-23 20:42:56 +02:00
// See https://aka.ms/new-console-template for more information
2024-05-06 00:29:23 +02:00
/*
* Test CLI application for development of DotBased
*/
using DotBased.Logging.Serilog;
2024-04-23 20:42:56 +02:00
using DotBased.Logging;
using DotBased.Utilities;
2024-04-23 20:42:56 +02:00
using Serilog;
using ILogger = Serilog.ILogger;
LogService.Initialize(options =>
{
options
.AddSeverityFilter("Program", LogSeverity.Verbose)
.AddSeverityFilter("DotBased.dll", LogSeverity.Verbose);
});
2024-04-23 20:42:56 +02:00
var serilogLogger = SetupSerilog();
2024-07-07 15:10:28 +02:00
LogService.AddLogAdapter(new BasedSerilogAdapter(serilogLogger));
var logger = LogService.RegisterLogger<Program>();
2024-04-23 20:42:56 +02:00
logger.Information("Whoah... Hi!, {Param}", "Test!");
var cult = Culture.GetSystemCultures();
2024-05-04 22:21:15 +02:00
2024-05-04 17:30:57 +02:00
Console.ReadKey(); // Hold console app open.
return;
2024-04-23 20:42:56 +02:00
ILogger SetupSerilog()
{
var logConfig = new LoggerConfiguration()
2024-04-23 20:42:56 +02:00
.MinimumLevel.Verbose()
2024-07-07 17:41:54 +02:00
.WriteTo.Console(outputTemplate: BasedSerilog.OutputTemplate);
2024-04-23 20:42:56 +02:00
return logConfig.CreateLogger();
}