private void LogContent(SourceLog sourcelog) { var item = AmountLogers3.FirstOrDefault(n => n.LogType == sourcelog.LogType && n.Logger == sourcelog.Logger && n.Message == sourcelog.Message); if (item == null) { item = new ReportLogContent { LogType = sourcelog.LogType, Logger = sourcelog.Logger, Message = sourcelog.Message }; AmountLogers3.Add(item); } Add(sourcelog.Time, item); }
private void LogTypeAndLogger(SourceLog sourcelog) { var item = AmountLogers2.FirstOrDefault(n => n.LogType == sourcelog.LogType && n.Logger == sourcelog.Logger); if (item == null) { item = new ReportLog { LogType = sourcelog.LogType, Logger = sourcelog.Logger }; AmountLogers2.Add(item); } Add(sourcelog.Time, item); }
SourceLog Log(string[] source) { if (source == null || source.Length < 4) throw new Exception();//format error var log = new SourceLog(source); log.Time = DateTime.Parse(source[0]); log.LogType = source[1]; log.Logger = source[2]; log.Message = source[3]; if (source.Length > 4) log.Error =new LogException { Message = source[4] }; return log; }
private void Logtype(SourceLog sourcelog) { var item = AmountLogers.FirstOrDefault(n => n.LogType == sourcelog.LogType); if (item == null) return; Add(sourcelog.Time, item); }
public void AddLog(SourceLog sourcelog) { LogTypeAndLogger(sourcelog); LogContent(sourcelog); Logtype(sourcelog); }
protected void OnNewLog(SourceLog log) { var hanlder = NewLog; if (hanlder == null) return; hanlder.Invoke(this, new NewLogEventArgs(log)); }
public NewLogEventArgs(SourceLog log) { this.Log = log; }