NadekoBot/NadekoBot.Core/Services/LogSetup.cs
2017-09-30 00:46:33 +02:00

24 lines
627 B
C#

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()
{
Layout = @"${date:format=HH\:mm\:ss} ${logger:shortName=True} | ${message}"
};
logConfig.AddTarget("Console", consoleTarget);
logConfig.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, consoleTarget));
LogManager.Configuration = logConfig;
}
}
}