/// <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); }
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(); } }
public override string ToString() { return(String.Format("{0} {1} {2}", Date, TypeOfLog.GetStringValue(), Comment)); }
public LogModel(TypeOfLog typeOfLog, string comment) { Date = DateTime.Now; TypeOfLog = typeOfLog; Comment = comment; }
public IQueryable <LogsBuffer> GetList(TypeOfLog type) { return(base.GetList().Where(log => log.Type == type)); }
public static void WriteLog(string value, TypeOfLog type, string code) { WriteLogToRam(new LogsBuffer { CreationDate = DateTime.Now, Type = type, Value = value, Code = code }); }
public static void WriteLog(string value, TypeOfLog type, Type classType) { WriteLog(value, type, classType.Name); }
public static void WriteLog(string value, TypeOfLog type) { WriteLog(value, type, string.Empty); }