2017-06-19 13:42:10 +00:00
|
|
|
|
using NLog;
|
|
|
|
|
using NLog.Config;
|
|
|
|
|
using NLog.Targets;
|
|
|
|
|
|
|
|
|
|
namespace NadekoBot.Services
|
|
|
|
|
{
|
|
|
|
|
public class LogSetup
|
|
|
|
|
{
|
|
|
|
|
public static void SetupLogger()
|
|
|
|
|
{
|
|
|
|
|
var logConfig = new LoggingConfiguration();
|
|
|
|
|
var consoleTarget = new ColoredConsoleTarget()
|
|
|
|
|
{
|
2017-09-16 00:10:22 +00:00
|
|
|
|
Layout = @"${date:format=HH\:mm\:ss} ${logger:shortName=True} | ${message}"
|
2017-06-19 13:42:10 +00:00
|
|
|
|
};
|
|
|
|
|
logConfig.AddTarget("Console", consoleTarget);
|
|
|
|
|
|
|
|
|
|
logConfig.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, consoleTarget));
|
|
|
|
|
|
|
|
|
|
LogManager.Configuration = logConfig;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|