mirror of
https://github.com/hmaxnl/DotBased.git
synced 2025-01-18 18:14:20 +01:00
38 lines
952 B
C#
Executable File
38 lines
952 B
C#
Executable File
// See https://aka.ms/new-console-template for more information
|
|
|
|
/*
|
|
* Test CLI application for development of DotBased
|
|
*/
|
|
|
|
|
|
using DotBased.Logging.Serilog;
|
|
using DotBased.Logging;
|
|
using DotBased.Utilities;
|
|
using Serilog;
|
|
using ILogger = Serilog.ILogger;
|
|
|
|
LogService.Initialize(options =>
|
|
{
|
|
options
|
|
.AddSeverityFilter("Program", LogSeverity.Verbose)
|
|
.AddSeverityFilter("DotBased.dll", LogSeverity.Verbose);
|
|
});
|
|
|
|
var serilogLogger = SetupSerilog();
|
|
LogService.AddLogAdapter(new BasedSerilogAdapter(serilogLogger));
|
|
var logger = LogService.RegisterLogger<Program>();
|
|
|
|
logger.Information("Whoah... Hi!, {Param}", "Test!");
|
|
var cult = Culture.GetSystemCultures();
|
|
|
|
Console.ReadKey(); // Hold console app open.
|
|
return;
|
|
|
|
|
|
ILogger SetupSerilog()
|
|
{
|
|
var logConfig = new LoggerConfiguration()
|
|
.MinimumLevel.Verbose()
|
|
.WriteTo.Console(outputTemplate: BasedSerilog.OutputTemplate);
|
|
return logConfig.CreateLogger();
|
|
} |