Initial split of the modules
This commit is contained in:
23
NadekoBot.Core/Services/LogSetup.cs
Normal file
23
NadekoBot.Core/Services/LogSetup.cs
Normal file
@ -0,0 +1,23 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user