Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="query"></param>
        public void Clear(SessionLogClearQuery query = null)
        {
            query = query ?? new SessionLogClearQuery();
            var newlog = new ConcurrentBag <LogMessage>();

            foreach (var message in _log)
            {
                if (message.RequireAccept)
                {
                    if (query.KeepAllRequests)
                    {
                        newlog.Add(message);
                        continue;
                    }
                    if (query.KeepAccpeted || !message.Accepted)
                    {
                        newlog.Add(message);
                        continue;
                    }
                }
                if (message.Level > query.MaxLevel)
                {
                    continue;
                }
                if (0 != query.EndTimestamp && message.Timestamp <= query.EndTimestamp)
                {
                    continue;
                }

                newlog.Add(message);
            }
            _log = newlog;
        }
Exemple #2
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="query"></param>
		public void Clear(SessionLogClearQuery query = null){
			query = query??new SessionLogClearQuery();
			var newlog = new ConcurrentBag<LogMessage>();
			foreach (var message in _log){
				if (message.RequireAccept){
					if (query.KeepAllRequests){
						newlog.Add(message);
						continue;
					}
					if (query.KeepAccpeted || !message.Accepted){
						newlog.Add(message);
						continue;
					}
				}
				if(message.Level>query.MaxLevel)continue;
				if(0!=query.EndTimestamp && message.Timestamp<=query.EndTimestamp)continue;
				
				newlog.Add(message);
			}
			_log = newlog;
		}