コード例 #1
0
ファイル: TraceCore.cs プロジェクト: YunLi1988/ServiceBusFake
        internal static void HandledException(DiagnosticTrace trace, Exception exception)
        {
            TracePayload serializedPayload = DiagnosticTrace.GetSerializedPayload(null, null, exception);

            if (TraceCore.IsEtwEventEnabled(trace, 1))
            {
                TraceCore.WriteEtwEvent(trace, 1, serializedPayload.SerializedException, serializedPayload.AppDomainFriendlyName);
            }
            if (trace.ShouldTraceToTraceSource(TraceEventLevel.Informational))
            {
                string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("HandledException", TraceCore.Culture), new object[0]);
                TraceCore.WriteTraceSource(trace, 1, str, serializedPayload);
            }
        }
コード例 #2
0
ファイル: TraceCore.cs プロジェクト: YunLi1988/ServiceBusFake
        internal static void TraceCodeEventLogCritical(DiagnosticTrace trace, TraceRecord traceRecord)
        {
            TracePayload serializedPayload = DiagnosticTrace.GetSerializedPayload(null, traceRecord, null);

            if (TraceCore.IsEtwEventEnabled(trace, 6))
            {
                TraceCore.WriteEtwEvent(trace, 6, serializedPayload.ExtendedData, serializedPayload.AppDomainFriendlyName);
            }
            if (trace.ShouldTraceToTraceSource(TraceEventLevel.Critical))
            {
                string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("TraceCodeEventLogCritical", TraceCore.Culture), new object[0]);
                TraceCore.WriteTraceSource(trace, 6, str, serializedPayload);
            }
        }
コード例 #3
0
ファイル: TraceCore.cs プロジェクト: YunLi1988/ServiceBusFake
 private static void WriteTraceSource(DiagnosticTrace trace, int eventIndex, string description, TracePayload payload)
 {
     TraceCore.EnsureEventDescriptors();
     trace.WriteTraceSource(ref TraceCore.eventDescriptors[eventIndex], description, payload);
 }