Beispiel #1
0
        private static void ProcessTraceEvent(TraceEvent data)
        {
            if (data.EventName == "ManifestData")
            {
                return;
            }

            var sb = new StringBuilder();

            sb.AppendFormat("{0}-{1}-{2}: ", data.TimeStamp.ToString("mm:ss.fff"), data.ProcessID.ToString("D5"), data.ThreadID.ToString("D5"));
            var pns = from pn in data.PayloadNames
                      where pn != "MSec" && pn != "PID" && pn != "TID"
                      select pn;

            sb = pns.Aggregate(sb, (acc, pn) => acc.AppendFormat("{0}, ", data.GetValue(pn)));

            WriteStringWithColor(data.Level, sb.ToString().Trim().Trim(','));
        }