Example #1
0
 private void _Add(string msg, LogEntry.LogLevel lvl)
 {
     Application
     .Current
     .Dispatcher
     .Invoke((Action)(() => Add(new LogEntry(msg, lvl))));
 }
Example #2
0
 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
         });
     }
 }
Example #3
0
File: Log.cs Project: Edll/iow
 /// <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());
 }
Example #4
0
File: Log.cs Project: Edll/iow
 /// <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);
 }