public override LogListViewItem Convert(string line, out bool succeeded)
        {
            var tokens = line.Split(new[] { ' ', '\t' }, 3, StringSplitOptions.RemoveEmptyEntries);
            var item   = new LogListViewItem();

            succeeded = false;
            if (tokens.Length < 3)
            {
                return(item);
            }

            int threadId;

            if (!int.TryParse(tokens[1].Trim('(', ')', ':'), out threadId))
            {
                return(item);
            }

            succeeded     = true;
            item.ThreadId = threadId.ToString(CultureInfo.InvariantCulture);
            item.Time     = tokens[0];
            item.Message  = tokens[2];

            return(item);
        }
Ejemplo n.º 2
0
 public virtual double GetTraceTimeInMs(LogListViewItem item)
 {
     if (IsTraceLeave(item))
     {
         return(GetTimeFromTraceLeave(item.Message));
     }
     return(int.MinValue);
 }
            public override int CompareItems(LogListViewItem x, LogListViewItem y)
            {
                var result = String.Compare(x.Time, y.Time);

                if (result == 0)
                {
                    result = x.LineNr - y.LineNr;
                }
                return(result);
            }
            public int Compare(object x, object y)
            {
                LogListViewItem item1 = x as LogListViewItem;
                LogListViewItem item2 = y as LogListViewItem;

                int returnVal = CompareItems(item1, item2);

                if (sortOrder == ListSortDirection.Descending)
                {
                    returnVal *= -1;
                }
                return(returnVal);
            }
        //12.01.2010 14:56:25 - Log    - Bluehands.Repository.Log.PerfCounter - planning phase duration (s): 0.344
        public override LogListViewItem Convert(string line, out bool succeeded)
        {
            succeeded = false;
            var item   = new LogListViewItem();
            var tokens = line.Split(' ');

            if (tokens.Length > 5)
            {
                item.Time  = string.Concat(tokens[0], " ", tokens[1]);
                item.Level = tokens[3];
                var message = new StringBuilder(tokens[5]);
                for (int i = 5; i < tokens.Length; i++)
                {
                    message.Append(" ");
                    message.Append(tokens[i]);
                }
                item.Message = message.ToString();
                succeeded    = true;
            }
            return(item);
        }
Ejemplo n.º 6
0
        public override LogListViewItem Convert(string line, out bool succeeded)
        {
            succeeded = false;
            var tokens = line.Split(' ');
            var item   = new LogListViewItem();

            if (tokens.Length >= 4)
            {
                item.Time  = tokens[0] + " " + tokens[1];
                item.Level = tokens[2];

                var message = new StringBuilder(tokens[3]);
                for (var i = 4; i < tokens.Length; i++)
                {
                    message.Append(" ");
                    message.Append(tokens[i].Replace("\t", " "));
                }
                item.Message = message.ToString();
                succeeded    = true;
            }
            return(item);
        }
 public override int CompareItems(LogListViewItem x, LogListViewItem y)
 {
     return(String.Compare(x.ThreadId, y.ThreadId));
 }
Ejemplo n.º 8
0
 public virtual bool IsTraceLeave(LogListViewItem item)
 {
     return(false);
 }
Ejemplo n.º 9
0
 bool MatchesCurrentLineNrFilter(LogListViewItem item) => item.LineNr >= m_MinVisibleLineNr && item.LineNr <= m_MaxVisibleLineNr;
Ejemplo n.º 10
0
 public bool MatchesCurrentFilter(LogListViewItem item) => m_Filters.Matches(item);
 public override int CompareItems(LogListViewItem x, LogListViewItem y)
 {
     return(x.LineNr - y.LineNr);
 }
 public override int CompareItems(LogListViewItem x, LogListViewItem y)
 {
     return(String.Compare(x.Level, y.Level));
 }
Ejemplo n.º 13
0
 public override bool IsTraceEnter(LogListViewItem item)
 {
     return((item.Level == "TRACE") && item.Message.Contains("[Enter]"));
 }
 public override bool IsTraceLeave(LogListViewItem item)
 {
     return(item.Message.EndsWith(c_TraceLeavePattern));
 }
Ejemplo n.º 15
0
 static bool MatchAll(LogListViewItem _) => true;
 public override int CompareItems(LogListViewItem x, LogListViewItem y)
 {
     return(String.Compare(x.Filename, y.Filename));
 }
 public abstract int CompareItems(LogListViewItem x, LogListViewItem y);
 public override bool IsTraceEnter(LogListViewItem item)
 {
     return(item.Level == c_TraceLevelIdentifier && item.Message.EndsWith(c_TraceEnterPattern));
 }
 public override bool IsTraceLeave(LogListViewItem item)
 {
     return(item.Level == c_TraceLevelIdentifier && item.Message.Contains(c_TraceLeavePattern));
 }
Ejemplo n.º 20
0
 public bool Matches(LogListViewItem item) => m_Filters.Values.All(f => f.Matches(item));
 public override int CompareItems(LogListViewItem x, LogListViewItem y)
 {
     return(String.Compare(x.Instance, y.Instance));
 }
Ejemplo n.º 22
0
 public override bool IsTraceLeave(LogListViewItem item)
 {
     return((item.Level == "Trace") && item.Message.Contains("[Leave"));
 }
 public override int CompareItems(LogListViewItem x, LogListViewItem y)
 {
     return(String.Compare(x.Message.Trim(), y.Message.Trim()));
 }