当前位置: 首页>>代码示例>>C#>>正文


C# TraceEvent类代码示例

本文整理汇总了C#中TraceEvent的典型用法代码示例。如果您正苦于以下问题:C# TraceEvent类的具体用法?C# TraceEvent怎么用?C# TraceEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TraceEvent类属于命名空间,在下文中一共展示了TraceEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetKey

 public String GetKey(TraceEvent traceEvent)
 {
     // Original code combined the Provider GUID with the machine name
       // but you cannot mix events with different partition keys in the same
       // batch.
       return Environment.MachineName;
 }
开发者ID:naveensrinivasan,项目名称:iis-etw-tracing,代码行数:7,代码来源:BasicPartitionKeyGenerator.cs

示例2: Send

 public void Send(TraceEvent eventData)
 {
     lock (this.eventList)
     {
         this.EventList.Add(eventData);
     }
 }
开发者ID:ZeoAlliance,项目名称:ApplicationInsights-dotnet,代码行数:7,代码来源:DiagnosticsEventCollectingMock.cs

示例3: Format

 public string Format(TraceEvent traceEvent)
 {
     //string ret = format;
     return format.
         Replace("{%ContextHolderId}", traceEvent.ContextIdentifier.ContextHolderId.ToString()).
         Replace("{%ExternalId}", traceEvent.ContextIdentifier.ExternalId.ToString()).
         Replace("{%ExternalReference}", traceEvent.ContextIdentifier.ExternalReference.ToString()).
         Replace("{%ExternalParentId}", traceEvent.ContextIdentifier.ExternalParentId.ToString()).
         Replace("{%InternalId}", traceEvent.ContextIdentifier.InternalId.ToString()).
         Replace("{%InternalParentId}", traceEvent.ContextIdentifier.InternalParentId.ToString()).
         Replace("{%ContextGuid}", traceEvent.ContextIdentifier.ContextGuid.ToString()).
         Replace("{%HostName}", traceEvent.Location.HostName).
         Replace("{%ModulePath}", traceEvent.Location.ModulePath).
         Replace("{%Principal}", traceEvent.Principal.Name).
         Replace("{%ThreadName}", traceEvent.Location.ThreadName).
         Replace("{%Message}", traceEvent.Message).
         Replace("{%Source}", traceEvent.Location.Source).
         Replace("{%Type}", traceEvent.Type.ToString()).
         Replace("{%Category}", traceEvent.Category.ToString()).
         Replace("{%EventIdText}", traceEvent.EventIdText).
         Replace("{%Time}", traceEvent.Time.ToString("dd-MMM-yyyyTHH:mm:ss (fff)")).
         Replace("{%EventId}", traceEvent.EventId.ToString()
         );
     // TODO: Provide specific format handling for the DateTime (SD)
 }
开发者ID:alienwaredream,项目名称:toolsdotnet,代码行数:25,代码来源:PlaceHolderFormatter.cs

示例4: BeginIteration

 public override void BeginIteration(TraceEvent beginEvent)
 {
     _objects = new ListMetricInfo();
     _objects.clear();
     _objects.hasCount = true;
     _objects.hasBytes = true;
 }
开发者ID:visia,项目名称:xunit-performance,代码行数:7,代码来源:ObjectsAllocated_MainThreadMetricDiscoverer.cs

示例5: InstanceConfiguration

 public InstanceConfiguration(DataSetConfiguration dataSet, ObservableCollection<MessageHandlerConfiguration> availableHandlers, TraceEvent trace, Action onModification)
 {
     AvailableMessageHandlers = availableHandlers;
     AssociatedMessageHandlers = new ObservableCollection<MessageHandlerConfiguration>(availableHandlers.Where<MessageHandlerConfiguration>(x => x.Associated(dataSet.AssociationName)).ToArray<MessageHandlerConfiguration>());
     DataSetConfiguration = dataSet;
     PropertyChanged += (x, y) => onModification();
 }
开发者ID:yuriik83,项目名称:OPC-UA-OOI,代码行数:7,代码来源:InstanceConfigurationFactory.cs

示例6: TraceEvent

 public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
 {
     var te = new TraceEvent {Cache = eventCache, Source = source, Type = eventType, Id = id};
     Events.Add(te);
     if (OnEventAdd != null)
         OnEventAdd.Invoke(te);
 }
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:7,代码来源:CacheTraceListener.cs

示例7: Trace

        /// <inheritdoc/>
        public override void Trace(TraceEvent traceEvent)
        {
            if (traceEvent == null)
            {
                throw new ArgumentNullException("traceEvent");
            }

            if (ShouldIgnore(traceEvent))
            {
                return;
            }

            try
            {
                foreach (TraceFilter filter in Filters)
                {
                    // trace must be passed to all filters (even if no notifications will be
                    // performed due to throttling) to allow them to continue to accumulate their results
                    if (filter.Filter(traceEvent))
                    {
                        // Notify all subscribers
                        Notify(filter);
                    }
                }
            }
            catch
            {
                // Need to prevent infinite loops when calling out to user code
                // I.e., user code exception in error handler causes error filter/subscriber
                // to be called again.
            }
        }
开发者ID:brendankowitz,项目名称:azure-webjobs-sdk-extensions,代码行数:33,代码来源:TraceMonitor.cs

示例8: EventReceived

        private void EventReceived(TraceEvent traceEvent)
        {
            DisplayTraceEvent dte = new DisplayTraceEvent
            {
                TraceEvent = traceEvent,
            };

            foreach (IDisplayTraceEvents idt in _viewers)
            {
                if (idt.IsApplicable(traceEvent))
                {
                    dte.DisplayTemplates.Add(idt.GetDisplayTemplate());

                    DataTemplate listTemplate = idt.GetListItemTemplate();

                    if (listTemplate != null)
                    {
                        dte.ListTemplate = listTemplate;
                    }
                }
            }

            DisplayTraceEvents.Add(dte);
            SelectedTab = 0;
        }
开发者ID:Balansir,项目名称:Backload,代码行数:25,代码来源:MainViewModel.cs

示例9: Trace

 public override void Trace(TraceEvent traceEvent)
 {
     // TODO: figure out the right log file format
     // TODO: buffer logs and write only periodically
     AppendLine(traceEvent.Message);
     if (traceEvent.Exception != null)
     {
         if (traceEvent.Exception is FunctionInvocationException ||
             traceEvent.Exception is AggregateException)
         {
             // we want to minimize the stack traces for function invocation
             // failures, so we drill into the very inner exception, which will
             // be the script error
             Exception actualException = traceEvent.Exception;
             while (actualException.InnerException != null)
             {
                 actualException = actualException.InnerException;
             }
             AppendLine(actualException.Message);
         }
         else
         {
             AppendLine(traceEvent.Exception.ToString());
         }
     }
 }
开发者ID:cmatskas,项目名称:azure-webjobs-sdk-script,代码行数:26,代码来源:FileTraceWriter.cs

示例10: InvokeTextWriter

        protected override void InvokeTextWriter(TraceEvent traceEvent)
        {
            if (MapTraceLevel(traceEvent.Source, traceEvent.Level) <= _traceConfig.ConsoleLevel)
            {
                // For Errors/Warnings we change the Console color
                // for visibility
                var holdColor = Console.ForegroundColor;
                bool changedColor = false;
                switch (traceEvent.Level)
                {
                    case TraceLevel.Error:
                        Console.ForegroundColor = ConsoleColor.Red;
                        changedColor = true;
                        break;
                    case TraceLevel.Warning:
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        changedColor = true;
                        break;
                }

                base.InvokeTextWriter(traceEvent);

                if (changedColor)
                {
                    Console.ForegroundColor = holdColor;
                }
            }         
        }
开发者ID:chungvinhkhang,项目名称:azure-webjobs-sdk,代码行数:28,代码来源:ConsoleTraceWriter.cs

示例11: Write

 public override void Write(string message)
 {
     var te = new TraceEvent
                  {Cache = new TraceEventCache(), Message = message, Type = TraceEventType.Information};
     Events.Add(te);
     if (OnEventAdd != null)
         OnEventAdd.Invoke(te);
 }
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:8,代码来源:CacheTraceListener.cs

示例12: ProcessAction

 public unsafe ProcessAction(TraceEvent traceEvent)
 {
     EventName = traceEvent.EventName;
     OpcodeName = traceEvent.OpcodeName;
     PayloadNames = traceEvent.PayloadNames;
     //
     AffectedKeys = new AffectedKeys(traceEvent);
 }
开发者ID:Evlikat,项目名称:incinerate,代码行数:8,代码来源:ProcessAction.cs

示例13: Write

 public override void Write(string message)
 {
     TraceEvent te = new TraceEvent();
     te.Cache = new TraceEventCache();
     te.Message = message;
     te.Type = TraceEventType.Information;
     Events.Add(te);
     if(OnEventAdd != null)
         OnEventAdd.Invoke(te);
 }
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:10,代码来源:CacheTraceListener.cs

示例14: Trace

        public override void Trace(TraceEvent traceEvent)
        {
            if (Level < traceEvent.Level)
            {
                return;
            }

            _interceptor(traceEvent);
            InnerWriter.Trace(traceEvent);
        }
开发者ID:Azure,项目名称:azure-webjobs-sdk-script,代码行数:10,代码来源:InterceptingTraceWriter.cs

示例15: TraceEvent

 public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
 {
     TraceEvent te = new TraceEvent();
     te.Cache = eventCache;
     te.Source = source;
     te.Type = eventType;
     te.ID = id;
     Events.Add(te);
     if(OnEventAdd != null)
         OnEventAdd.Invoke(te);
 }
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:11,代码来源:CacheTraceListener.cs


注:本文中的TraceEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。