コード例 #1
0
 public override void LogMessage(LogRow row)
 {
     lock (queue) {
         queue.Enqueue(() => AsyncLogMessage(row));
     }
     hasNewItems.Set();
 }
コード例 #2
0
 public override void LogMessage(LogRow row)
 {
     lock (queue) {
         queue.Enqueue(() => AsyncLogMessage(row));
     }
     hasNewItems.Set();
 }
コード例 #3
0
 public override void LogMessage(LogRow row)
 {
     foreach (var logger in Loggers)
     {
         if (logger.Enabled)
         {
             logger.LogMessage(row);
         }
     }
 }
コード例 #4
0
        void LogMessage(LogSeverity severity, string message, string category)
        {
            if (!Enabled)
            {
                return;
            }

            string   threadName = Thread.CurrentThread.Name;
            int      threadId   = Thread.CurrentThread.ManagedThreadId;
            DateTime now        = DateTime.Now;

            LogRow row = new LogRow()
            {
                Severity   = severity,
                Message    = message,
                Category   = category,
                ThreadId   = threadId,
                ThreadName = threadName,
                Time       = now
            };

            LogMessage(row);
        }
コード例 #5
0
        public void TestLogMessagePersistance()
        {
            LogRow message = new LogRow()
            {
                Category = "aa,aa",
                Message = "hello\nworld",
                Severity = LogSeverity.Error,
                ThreadId = 100,
                ThreadName = "my big fat thread",
                Time = DateTime.Now
            };

            var copy = LogRow.FromString(message.ToString());

            Assert.AreEqual(message.Category, copy.Category);
            Assert.AreEqual(message.Message, copy.Message);
            Assert.AreEqual(message.Severity, copy.Severity);
            Assert.AreEqual(message.ThreadId, copy.ThreadId);
            Assert.AreEqual(message.ThreadName, copy.ThreadName);
            Assert.AreEqual(message.Time.Millisecond, copy.Time.Millisecond);
            Assert.AreEqual(message.Time.Second, copy.Time.Second);
            Assert.AreEqual(message.Time.Day, copy.Time.Day);
        }
コード例 #6
0
ファイル: FileLogger.cs プロジェクト: purplecow/Media-Browser
 protected override void AsyncLogMessage(LogRow row)
 {
     UpdateStream();
     writer.WriteLine(row.ToString());
 }
コード例 #7
0
 public override void LogMessage(LogRow row)
 {
     Trace.WriteLine(row.ToString());
 }
コード例 #8
0
        void LogMessage(LogSeverity severity, string message, string category)
        {

            if (!Enabled || severity < this.Severity) return;

            string threadName = Thread.CurrentThread.Name;
            int threadId = Thread.CurrentThread.ManagedThreadId;
            DateTime now = DateTime.Now;

            LogRow row = new LogRow()
            {
                Severity = severity,
                Message = message,
                Category = category,
                ThreadId = threadId,
                ThreadName = threadName,
                Time = now
            };

            LogMessage(row);
        }
コード例 #9
0
 public abstract void LogMessage(LogRow row);
コード例 #10
0
 public override void LogMessage(LogRow row)
 {
     foreach (var logger in Loggers) {
         if (logger.Enabled) logger.LogMessage(row);
     }
 }
コード例 #11
0
ファイル: FileLogger.cs プロジェクト: nickmayer/mediabrowser
 protected override void AsyncLogMessage(LogRow row)
 {
     UpdateStream();
     writer.WriteLine(row.ToString());
 }
コード例 #12
0
 public override void LogMessage(LogRow row)
 {
     Trace.WriteLine(row.ToString());
 }
コード例 #13
0
 protected abstract void AsyncLogMessage(LogRow row);
コード例 #14
0
 public abstract void LogMessage(LogRow row);
コード例 #15
0
 protected abstract void AsyncLogMessage(LogRow row);