Example #1
0
        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
        {
            if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, message, args: null, data1: null, data: null))
            {
                return;
            }

            mTraceList.AddItem(eventType.ToTraceListItemType(),
                               eventCache.Timestamp, source, message);
        }
Example #2
0
        public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
        {
            if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, null, args: null, data1: data, data: null))
            {
                return;
            }

            var item_data = GetDataEntryForTraceListItem(data);
            var message   = item_data.ToString();

            mTraceList.AddItem(eventType.ToTraceListItemType(),
                               eventCache.Timestamp, source, message, new object[] { item_data });
        }
Example #3
0
        public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data)
        {
            if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, null, args: null, data1: null, data: data))
            {
                return;
            }

            var item_data = GetDataForTraceListItem(data);
            var message   = item_data.Length > 0
                                ? item_data[0].ToString()
                                : "NO MESSAGE";

            mTraceList.AddItem(eventType.ToTraceListItemType(),
                               eventCache.Timestamp, source, message, item_data);
        }
Example #4
0
        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
        {
            if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, format, args, data1: null, data: null))
            {
                return;
            }

            string message;

            if (!args.IsNullOrEmpty())
            {
                message = string.Format(CultureInfo.InvariantCulture, format, args);
            }
            else
            {
                message = format;
            }

            mTraceList.AddItem(eventType.ToTraceListItemType(),
                               eventCache.Timestamp, source, message);
        }