public override void Trace(TraceEvent traceEvent)
 {
     InvokeTraceWriters(traceEvent);
     InvokeTextWriter(traceEvent);
 }
            public override bool Filter(TraceEvent traceEvent)
            {
                if (_predicate(traceEvent))
                {
                    return InnerTraceFilter.Filter(traceEvent);
                }

                return false;
            }
 /// <summary>
 /// Inspects the specified <see cref="TraceEvent"/> and accumulates it
 /// as needed if it matches the filter.
 /// </summary>
 /// <param name="traceEvent">The <see cref="TraceEvent"/> to filter.</param>
 /// <returns>True if the trace message should result in all subscribers being
 /// notified, false otherwise.</returns>
 public abstract bool Filter(TraceEvent traceEvent);
            public override bool Filter(TraceEvent traceEvent)
            {
                if (_predicate == null || _predicate(traceEvent))
                {
                    // this filter does not accumulate - it only keeps track
                    // of the last event, so we reset the collection each time.
                    _events.Clear();
                    _events.Add(traceEvent);

                    return true;
                }

                return false;
            }
Ejemplo n.º 5
0
 /// <summary>
 /// Writes a trace event.
 /// </summary>
 /// <param name="traceEvent">The <see cref="TraceEvent"/> to trace.</param>
 public abstract void Trace(TraceEvent traceEvent);
Ejemplo n.º 6
0
 public static void AddFunctionInstanceDetails(this TraceEvent traceEvent, Guid hostInstanceId, FunctionDescriptor descriptor, Guid functionId)
 {
     traceEvent.Properties[HostInstanceIdKey]       = hostInstanceId;
     traceEvent.Properties[FunctionDescriptorKey]   = descriptor;
     traceEvent.Properties[FunctionInvocationIdKey] = functionId;
 }