public void LogLineTest04() { var log = new DELogLine("2015-05-26 12:00:00:000\t2\tTest\\n\\tdata\\\\test\\0null"); Assert.AreEqual(BaseStamp, log.Stamp); Assert.AreEqual(LogMsgType.Error, log.Typ); Assert.AreEqual("Test\r\n\tdata\\test\0null", log.Text); }
public void LogLineTest03() { var log = new DELogLine("2015-05-26 12:00:00:000\t0\tTest data"); Assert.AreEqual(BaseStamp, log.Stamp); Assert.AreEqual(LogMsgType.Information, log.Typ); Assert.AreEqual("Test data", log.Text); }
} // prop SetLogSize #endregion #region -- IDELogConfig Members --------------------------------------------------- void ILogger.LogMsg(LogMsgType typ, string text) { Debug.Print("[{0}] {1}", Name, text); var logLine = new DELogLine(DateTime.Now, typ, text); if (Server.Queue?.IsQueueRunning ?? false) { Server.Queue.Factory.StartNew(() => logFile?.Add(logLine)); } else // Background thread is not in service, synchron add { logFile?.Add(logLine); } } // proc ILogger.LogMsg
} // prop SetLogSize #endregion #region -- IDELogConfig Members ----------------------------------------------- void ILogger.LogMsg(LogMsgType type, string text) { Debug.Print("[{0}] {1}", Name, text); // create log line if (IsDebug || type != LogMsgType.Debug) { var logLine = new DELogLine(DateTime.Now, type == LogMsgType.Debug ? LogMsgType.Information : type, text); if (Server.Queue?.IsQueueRunning ?? false) { Server.Queue.RegisterCommand(() => logFile?.Add(logLine)); } else // Background thread is not in service, synchron add { logFile?.Add(logLine); } } DEScope.GetScopeService <IDEDebugContext>(false)?.OnMessage(type, text); } // proc ILogger.LogMsg
public void LogLineTest02() { var log = new DELogLine(BaseStamp, LogMsgType.Error, "Test\n\t\rdata\\test\0null"); Assert.AreEqual("2015-05-26 12:00:00:000\t2\tTest\\n\\tdata\\\\test\\0null", log.ToLineData()); }
public void LogLineTest01() { var log = new DELogLine(BaseStamp, LogMsgType.Information, "Test data"); Assert.AreEqual("2015-05-26 12:00:00:000\t0\tTest data", log.ToLineData()); }