31 lines
649 B
C#
31 lines
649 B
C#
using System;
|
|
using NLog;
|
|
using NLog.Config;
|
|
using NLog.Targets;
|
|
using DataClient;
|
|
|
|
namespace Test2
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
LogConf();
|
|
var test = new STPClient();
|
|
Console.WriteLine("Hello World!");
|
|
}
|
|
static void LogConf()
|
|
{
|
|
var conf = new LoggingConfiguration();
|
|
var logcon = new ColoredConsoleTarget()
|
|
{
|
|
Name = "logcon",
|
|
Layout = @"${time}|${level:uppercase=true}|${logger}|${message}${when:when=length('${exception}')>0:Inner=|}${exception:format=ToString,StackTrace}"
|
|
};
|
|
|
|
conf.AddRule(LogLevel.Trace, LogLevel.Fatal, logcon);
|
|
LogManager.Configuration = conf;
|
|
}
|
|
}
|
|
}
|