Beispiel #1
0
 private void CacheEvent(string msg, LogLevel level) {
     CachedLogEntry entry = new CachedLogEntry {
         When = DateTime.Now,
         Message = msg,
         Level = level
     };
     LockAndAct(() => {
         FixedCache.Insert(0, entry);
         if (FixedCache.Count > ConfiguredCacheSize)
             FixedCache.RemoveAt(ConfiguredCacheSize);
     });
     Broadcast(entry);
 }
Beispiel #2
0
 private void Broadcast(CachedLogEntry entry) {
     if (Listeners.Any())
         Listeners.ToList().ForEach(kvp => kvp.Value(entry));
 }