Ejemplo n.º 1
0
 private List <LogViewModel> GetLogsByLevel(LoggingLevel level)
 {
     if (level == LoggingLevel.TRACE)
     {
         return(LogsTrace.Union(LogsDebug).Union(LogsInfo).Union(LogsWarn).Union(LogsError).Union(LogsFatal).ToList());
     }
     else if (level == LoggingLevel.DEBUG)
     {
         return(LogsDebug.Union(LogsInfo).Union(LogsWarn).Union(LogsError).Union(LogsFatal).ToList());
     }
     else if (level == LoggingLevel.INFO)
     {
         return(LogsInfo.Union(LogsWarn).Union(LogsError).Union(LogsFatal).ToList());
     }
     else if (level == LoggingLevel.WARN)
     {
         return(LogsWarn.Union(LogsError).Union(LogsFatal).ToList());
     }
     else if (level == LoggingLevel.ERROR)
     {
         return(LogsError.Union(LogsFatal).ToList());
     }
     else if (level == LoggingLevel.FATAL)
     {
         return(LogsFatal.ToList());
     }
     return(new List <LogViewModel>());
 }