public void Error(string format) { ErrorEntries.Add(new LogEntry { Format = format, }); }
public void Error(string format, params object[] args) { ErrorEntries.Add(new LogEntry { Format = format, Params = args, }); }
public void Error(Exception exception, string format, params object[] args) { ErrorEntries.Add(new LogEntry { Format = format, Params = args, Exception = exception }); }
public void Error(string message, string location = null, Exception exception = null) { LogEntry logEvent = new LogEntry { ID = 0, Message = message, TimeStamp = DateTime.UtcNow, Type = Enums.LogLevel.DEBUG, UserName = "******", Location = location }; var eventname = Environment.StackTrace.Split('\n').Select(o => o.Substring(0, o.Length - 3)).Where(o => EventByFrame.Keys.Any(k => o.Equals(k))); if (eventname.Any()) { logEvent.Event = EventByFrame.Where(o => eventname.Contains(o.Key)).Select(o => o.Value).FirstOrDefault(); logEvent.EventTrace = string.Join(",", EventByFrame.Where(o => eventname.Contains(o.Key)).Select(o => o.Value).ToArray()); } ErrorEntries.Add(logEvent); }