24 lines
569 B
C#
24 lines
569 B
C#
using System;
|
|
using NLog;
|
|
using NLog.Extensions.Logging;
|
|
|
|
namespace ChaosBot
|
|
{
|
|
public class Logging
|
|
{
|
|
public static Logger GenLog()
|
|
{
|
|
try
|
|
{
|
|
LogManager.Configuration = new NLogLoggingConfiguration(Program.Cfg.GetSection("NLog"));
|
|
|
|
return LogManager.GetCurrentClassLogger();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine($"Logging.Logger: Exception [{ex}] thrown, <[{ex.Message}]>.");
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
} |