/// <summary>
 /// Gets trace definition like: AppDomain unloading. AppDomain.FriendlyName {0}, ProcessName {1}, ProcessId {2}.
 /// Event description ID=57393, Level=informational, Channel=Debug
 /// </summary>
 /// <param name="trace">The trace provider</param>
 /// <param name="appdomainName">Parameter 0 for event: AppDomain unloading. AppDomain.FriendlyName {0}, ProcessName {1}, ProcessId {2}.</param>
 /// <param name="processName">Parameter 1 for event: AppDomain unloading. AppDomain.FriendlyName {0}, ProcessName {1}, ProcessId {2}.</param>
 /// <param name="processId">Parameter 2 for event: AppDomain unloading. AppDomain.FriendlyName {0}, ProcessName {1}, ProcessId {2}.</param>
 internal static void AppDomainUnload(EtwDiagnosticTrace trace, string appdomainName, string processName, string processId)
 {
     TracePayload payload = trace.GetSerializedPayload(null, null, null);
     if (TraceCore.IsEtwEventEnabled(trace, 0))
     {
         TraceCore.WriteEtwEvent(trace, 0, null, appdomainName, processName, processId, payload.AppDomainFriendlyName);
     }
     if (trace.ShouldTraceToTraceSource(TraceEventLevel.Informational))
     {
         string description = string.Format(Culture, ResourceManager.GetString("AppDomainUnload", Culture), appdomainName, processName, processId);
         TraceCore.WriteTraceSource(trace, 0, description, payload);
     }
 }
 /// <summary>
 /// Gets trace definition like: Handling an exception. Exception details: {0}
 /// Event description ID=57405, Level=error, Channel=Operational
 /// </summary>
 /// <param name="trace">The trace provider</param>
 /// <param name="param0">Parameter 0 for event: Handling an exception. Exception details: {0}</param>
 /// <param name="exception">Exception associated with the event</param>
 internal static void HandledExceptionError(EtwDiagnosticTrace trace, string param0, System.Exception exception)
 {
     TracePayload payload = trace.GetSerializedPayload(null, null, exception);
     if (TraceCore.IsEtwEventEnabled(trace, 15))
     {
         TraceCore.WriteEtwEvent(trace, 15, null, param0, payload.SerializedException, payload.AppDomainFriendlyName);
     }
     if (trace.ShouldTraceToTraceSource(TraceEventLevel.Error))
     {
         string description = string.Format(Culture, ResourceManager.GetString("HandledExceptionError", Culture), param0);
         TraceCore.WriteTraceSource(trace, 15, description, payload);
     }
 }
 /// <summary>
 /// Gets trace definition like: Throwing an exception. Source: {0}. Exception details: {1}
 /// Event description ID=57407, Level=verbose, Channel=Analytic
 /// </summary>
 /// <param name="trace">The trace provider</param>
 /// <param name="param0">Parameter 0 for event: Throwing an exception. Source: {0}. Exception details: {1}</param>
 /// <param name="param1">Parameter 1 for event: Throwing an exception. Source: {0}. Exception details: {1}</param>
 /// <param name="exception">Exception associated with the event</param>
 internal static void ThrowingExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
 {
     TracePayload payload = trace.GetSerializedPayload(null, null, exception);
     if (TraceCore.IsEtwEventEnabled(trace, 20))
     {
         TraceCore.WriteEtwEvent(trace, 20, null, param0, param1, payload.SerializedException, payload.AppDomainFriendlyName);
     }
     if (trace.ShouldTraceToTraceSource(TraceEventLevel.Verbose))
     {
         string description = string.Format(Culture, ResourceManager.GetString("ThrowingExceptionVerbose", Culture), param0, param1);
         TraceCore.WriteTraceSource(trace, 20, description, payload);
     }
 }
 /// <summary>
 /// Gets trace definition like: An unexpected failure occurred. Applications should not attempt to handle this error. For diagnostic purposes, this English message is associated with the failure: {0}.
 /// Event description ID=57395, Level=error, Channel=Analytic
 /// </summary>
 /// <param name="trace">The trace provider</param>
 /// <param name="param0">Parameter 0 for event: An unexpected failure occurred. Applications should not attempt to handle this error. For diagnostic purposes, this English message is associated with the failure: {0}.</param>
 internal static void ShipAssertExceptionMessage(EtwDiagnosticTrace trace, string param0)
 {
     TracePayload payload = trace.GetSerializedPayload(null, null, null);
     if (TraceCore.IsEtwEventEnabled(trace, 2))
     {
         TraceCore.WriteEtwEvent(trace, 2, null, param0, payload.AppDomainFriendlyName);
     }
     if (trace.ShouldTraceToTraceSource(TraceEventLevel.Error))
     {
         string description = string.Format(Culture, ResourceManager.GetString("ShipAssertExceptionMessage", Culture), param0);
         TraceCore.WriteTraceSource(trace, 2, description, payload);
     }
 }
 /// <summary>
 /// Gets trace definition like: Wrote to the EventLog.
 /// Event description ID=57403, Level=warning, Channel=Debug
 /// </summary>
 /// <param name="trace">The trace provider</param>
 /// <param name="traceRecord">Extended data (TraceRecord) for the event</param>
 internal static void TraceCodeEventLogWarning(EtwDiagnosticTrace trace, TraceRecord traceRecord)
 {
     TracePayload payload = trace.GetSerializedPayload(null, traceRecord, null);
     if (TraceCore.IsEtwEventEnabled(trace, 9))
     {
         TraceCore.WriteEtwEvent(trace, 9, null, payload.ExtendedData, payload.AppDomainFriendlyName);
     }
     if (trace.ShouldTraceToTraceSource(TraceEventLevel.Warning))
     {
         string description = string.Format(Culture, ResourceManager.GetString("TraceCodeEventLogWarning", Culture));
         TraceCore.WriteTraceSource(trace, 9, description, payload);
     }
 }
Ejemplo n.º 6
0
		internal static void AppDomainUnload(EtwDiagnosticTrace trace, string appdomainName, string processName, string processId)
		{
			TracePayload serializedPayload = trace.GetSerializedPayload(null, null, null);
			if (TraceCore.IsEtwEventEnabled(trace, 0))
			{
				TraceCore.WriteEtwEvent(trace, 0, null, appdomainName, processName, processId, serializedPayload.AppDomainFriendlyName);
			}
			if (trace.ShouldTraceToTraceSource(TraceEventLevel.Informational))
			{
				object[] objArray = new object[3];
				objArray[0] = appdomainName;
				objArray[1] = processName;
				objArray[2] = processId;
				string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("AppDomainUnload", TraceCore.Culture), objArray);
				TraceCore.WriteTraceSource(trace, 0, str, serializedPayload);
			}
		}
Ejemplo n.º 7
0
		internal static void UnhandledException(EtwDiagnosticTrace trace, string param0, Exception exception)
		{
			TracePayload serializedPayload = trace.GetSerializedPayload(null, null, exception);
			if (TraceCore.IsEtwEventEnabled(trace, 4))
			{
				TraceCore.WriteEtwEvent(trace, 4, null, param0, serializedPayload.SerializedException, serializedPayload.AppDomainFriendlyName);
			}
			if (trace.ShouldTraceToTraceSource(TraceEventLevel.Critical))
			{
				object[] objArray = new object[1];
				objArray[0] = param0;
				string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("UnhandledException", TraceCore.Culture), objArray);
				TraceCore.WriteTraceSource(trace, 4, str, serializedPayload);
			}
		}
Ejemplo n.º 8
0
		internal static void TraceCodeEventLogVerbose(EtwDiagnosticTrace trace, TraceRecord traceRecord)
		{
			TracePayload serializedPayload = trace.GetSerializedPayload(null, traceRecord, null);
			if (TraceCore.IsEtwEventEnabled(trace, 8))
			{
				TraceCore.WriteEtwEvent(trace, 8, null, serializedPayload.ExtendedData, serializedPayload.AppDomainFriendlyName);
			}
			if (trace.ShouldTraceToTraceSource(TraceEventLevel.Verbose))
			{
				string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("TraceCodeEventLogVerbose", TraceCore.Culture), new object[0]);
				TraceCore.WriteTraceSource(trace, 8, str, serializedPayload);
			}
		}
Ejemplo n.º 9
0
		internal static void ThrowingExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, Exception exception)
		{
			TracePayload serializedPayload = trace.GetSerializedPayload(null, null, exception);
			if (TraceCore.IsEtwEventEnabled(trace, 20))
			{
				TraceCore.WriteEtwEvent(trace, 20, null, param0, param1, serializedPayload.SerializedException, serializedPayload.AppDomainFriendlyName);
			}
			if (trace.ShouldTraceToTraceSource(TraceEventLevel.Verbose))
			{
				object[] objArray = new object[2];
				objArray[0] = param0;
				objArray[1] = param1;
				string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("ThrowingExceptionVerbose", TraceCore.Culture), objArray);
				TraceCore.WriteTraceSource(trace, 20, str, serializedPayload);
			}
		}
Ejemplo n.º 10
0
		internal static void ShipAssertExceptionMessage(EtwDiagnosticTrace trace, string param0)
		{
			TracePayload serializedPayload = trace.GetSerializedPayload(null, null, null);
			if (TraceCore.IsEtwEventEnabled(trace, 2))
			{
				TraceCore.WriteEtwEvent(trace, 2, null, param0, serializedPayload.AppDomainFriendlyName);
			}
			if (trace.ShouldTraceToTraceSource(TraceEventLevel.Error))
			{
				object[] objArray = new object[1];
				objArray[0] = param0;
				string str = string.Format(TraceCore.Culture, TraceCore.ResourceManager.GetString("ShipAssertExceptionMessage", TraceCore.Culture), objArray);
				TraceCore.WriteTraceSource(trace, 2, str, serializedPayload);
			}
		}