private void _Add(string msg, LogEntry.LogLevel lvl) { Application .Current .Dispatcher .Invoke((Action)(() => Add(new LogEntry(msg, lvl)))); }
private void WriteLog(LogEntry.LogLevel level, string message, Exception ex = null) { foreach (var log in _writers) { log.WriteLog(new LogEntry(level) { Message = message, Error = ex }); } }
/// <summary> /// Returns logs entry at the specified level /// </summary> /// <param name="level">Log Level</param> /// <returns>List of log entry at Level</returns> public List <LogEntry> GetLogEntrieyAtLevel(LogEntry.LogLevel level) { return(_logs.Where(logEntry => logEntry.Level.Equals(level)).ToList()); }
/// <summary> /// Add new LogEntry for a Device /// </summary> /// <param name="device">device</param> /// <param name="msg">log entry</param> /// <param name="level">log level</param> /// <returns>instance of this</returns> public Log AddLog(Device device, string msg, LogEntry.LogLevel level) { _logs.Add(LogEntry.NewLogEntry(device, msg, level)); return(this); }