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
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2024-04-24 16:52:25 +02:00
|
|
|
|
using DotBased.Logging.Serilog;
|
2024-04-23 20:42:56 +02:00
|
|
|
|
using DotBased.Logging;
|
2024-11-17 22:51:54 +01:00
|
|
|
|
using DotBased.Utilities;
|
2024-04-23 20:42:56 +02:00
|
|
|
|
using Serilog;
|
|
|
|
|
using ILogger = Serilog.ILogger;
|
|
|
|
|
|
2024-11-17 22:51:54 +01:00
|
|
|
|
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));
|
2024-11-17 22:51:54 +01:00
|
|
|
|
var logger = LogService.RegisterLogger<Program>();
|
2024-04-23 20:42:56 +02:00
|
|
|
|
|
2024-11-17 22:51:54 +01: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.
|
2024-04-24 16:52:25 +02:00
|
|
|
|
return;
|
2024-04-23 20:42:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ILogger SetupSerilog()
|
|
|
|
|
{
|
2024-04-24 16:52:25 +02:00
|
|
|
|
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();
|
|
|
|
|
}
|