本文整理汇总了C#中System.Runtime.Diagnostics.EtwDiagnosticTrace.ShouldTraceToTraceSource方法的典型用法代码示例。如果您正苦于以下问题:C# EtwDiagnosticTrace.ShouldTraceToTraceSource方法的具体用法?C# EtwDiagnosticTrace.ShouldTraceToTraceSource怎么用?C# EtwDiagnosticTrace.ShouldTraceToTraceSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Diagnostics.EtwDiagnosticTrace
的用法示例。
在下文中一共展示了EtwDiagnosticTrace.ShouldTraceToTraceSource方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppDomainUnload
/// <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);
}
}
示例2: HandledExceptionError
/// <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);
}
}
示例3: ThrowingExceptionVerbose
/// <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);
}
}
示例4: ShipAssertExceptionMessage
/// <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);
}
}
示例5: TraceCodeEventLogWarning
/// <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);
}
}
示例6: AppDomainUnload
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);
}
}
示例7: UnhandledException
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);
}
}
示例8: TraceCodeEventLogVerbose
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);
}
}
示例9: ThrowingExceptionVerbose
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);
}
}
示例10: ShipAssertExceptionMessage
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);
}
}