예제 #1
0
        /// <summary>
        /// Make log with next parameters: type, date, module, logString
        /// </summary>
        /// <param name="type">Type of log message</param>
        /// <param name="date">Date of log message</param>
        /// <param name="module">Module where log was recorded</param>
        /// <param name="logString">Text of message</param>
        public void Log(TypeOfLog type, DateTime date, Type module, string logString)
        {
            LoggerAssist ls = new LoggerAssist(type, date, module, logString);

            Console.WriteLine($"{type}\t{date}\t{module}\t{logString}");
            string[] arr = new string[1] {
                String.Concat(type.ToString(), "\t", date.ToString(), "\t", module.ToString(), "\t", logString)
            };
            Serialize serialize = new Serialize();

            serialize.StartSerialize(ls, arr);
        }
예제 #2
0
        public static void WriteLogInDB(string value, TypeOfLog type, string code)//ILogsBusiness logsBusiness,
        {
            WriteLog(value, type, code);
            //logsBusiness.Create(new LogsBuffer
            //{
            //    Type = type,
            //    CreationDate = DateTime.Now,
            //    Value = value.SubstringM(0, 1024),
            //    Code = code.SubstringM(0, 64)
            //});

            if (buffers.Count > MaxBufferSize)
            {
                StackOverFlow = true;
                buffers.Clear();
            }
        }
예제 #3
0
 public override string ToString()
 {
     return(String.Format("{0} {1} {2}", Date, TypeOfLog.GetStringValue(), Comment));
 }
예제 #4
0
 public LogModel(TypeOfLog typeOfLog, string comment)
 {
     Date      = DateTime.Now;
     TypeOfLog = typeOfLog;
     Comment   = comment;
 }
예제 #5
0
 public IQueryable <LogsBuffer> GetList(TypeOfLog type)
 {
     return(base.GetList().Where(log => log.Type == type));
 }
예제 #6
0
 public static void WriteLog(string value, TypeOfLog type, string code)
 {
     WriteLogToRam(new LogsBuffer {
         CreationDate = DateTime.Now, Type = type, Value = value, Code = code
     });
 }
예제 #7
0
 public static void WriteLog(string value, TypeOfLog type, Type classType)
 {
     WriteLog(value, type, classType.Name);
 }
예제 #8
0
 public static void WriteLog(string value, TypeOfLog type)
 {
     WriteLog(value, type, string.Empty);
 }