예제 #1
0
        void Awake()
        {
            _socket = new SocketAppender();
            _defaultFormatter = new DefaultLogMessageFormatter();
            _timestampFormatter = new TimestampFormatter();
            _colorFormatter = new ColorCodeFormatter();

            if (cacheLogsWhenNotConnected) {
                LoggerFactory.AddAppender(send);
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: sschmid/NLog
 static void consoleLogTest()
 {
     var defaultFormatter = new DefaultLogMessageFormatter();
     var timestampFormatter = new TimestampFormatter();
     var colorFormatter = new ColorCodeFormatter();
     LoggerFactory.AddAppender((logger, logLevel, message) => {
         message = defaultFormatter.FormatMessage(logger, logLevel, message);
         message = timestampFormatter.FormatMessage(logger, logLevel, message);
         message = colorFormatter.FormatMessage(logLevel, message);
         Console.WriteLine(message);
     });
 }
예제 #3
0
 void Awake()
 {
     _fileWriter = new FileWriter(filePath);
     _defaultFormatter = new DefaultLogMessageFormatter();
     _timestampFormatter = new TimestampFormatter();
 }