Exemplo n.º 1
0
Arquivo: Stuff.cs Projeto: s72785/des
        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);
        }
Exemplo n.º 2
0
Arquivo: Stuff.cs Projeto: s72785/des
        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);
        }
Exemplo n.º 3
0
        }         // 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
Exemplo n.º 4
0
        }         // 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
Exemplo n.º 5
0
Arquivo: Stuff.cs Projeto: s72785/des
        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());
        }
Exemplo n.º 6
0
Arquivo: Stuff.cs Projeto: s72785/des
        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());
        }