public void TraceEtwException(Exception exception, TraceEventType eventType) { switch (eventType) { case TraceEventType.Error: case TraceEventType.Warning: if (TraceCore.ThrowingEtwExceptionIsEnabled(this.diagnosticTrace)) { TraceCore.ThrowingEtwException(this.diagnosticTrace, this.eventSourceName, exception != null ? exception.ToString() : string.Empty, exception); } break; case TraceEventType.Critical: if (TraceCore.EtwUnhandledExceptionIsEnabled(this.diagnosticTrace)) { TraceCore.EtwUnhandledException(this.diagnosticTrace, exception != null ? exception.ToString() : string.Empty, exception); } break; default: if (TraceCore.ThrowingEtwExceptionVerboseIsEnabled(this.diagnosticTrace)) { TraceCore.ThrowingEtwExceptionVerbose(this.diagnosticTrace, this.eventSourceName, exception != null ? exception.ToString() : string.Empty, exception); } break; } }
public void TraceEtwException(Exception exception, TraceEventType eventType) { string str; string empty; string str1; TraceEventType traceEventType = eventType; switch (traceEventType) { case TraceEventType.Critical: { if (!TraceCore.UnhandledExceptionIsEnabled(this.diagnosticTrace)) { break; } EtwDiagnosticTrace etwDiagnosticTrace = this.diagnosticTrace; if (exception != null) { str = exception.ToString(); } else { str = string.Empty; } TraceCore.EtwUnhandledException(etwDiagnosticTrace, str, exception); return; } case TraceEventType.Error: case TraceEventType.Warning: { if (!TraceCore.ThrowingExceptionIsEnabled(this.diagnosticTrace)) { break; } EtwDiagnosticTrace etwDiagnosticTrace1 = this.diagnosticTrace; string str2 = this.eventSourceName; if (exception != null) { empty = exception.ToString(); } else { empty = string.Empty; } TraceCore.ThrowingEtwException(etwDiagnosticTrace1, str2, empty, exception); return; } case TraceEventType.Critical | TraceEventType.Error: { if (!TraceCore.ThrowingExceptionVerboseIsEnabled(this.diagnosticTrace)) { break; } EtwDiagnosticTrace etwDiagnosticTrace2 = this.diagnosticTrace; string str3 = this.eventSourceName; if (exception != null) { str1 = exception.ToString(); } else { str1 = string.Empty; } TraceCore.ThrowingEtwExceptionVerbose(etwDiagnosticTrace2, str3, str1, exception); break; } default: { if (!TraceCore.ThrowingExceptionVerboseIsEnabled(this.diagnosticTrace)) { break; } EtwDiagnosticTrace etwDiagnosticTrace2 = this.diagnosticTrace; string str3 = this.eventSourceName; if (exception != null) { str1 = exception.ToString(); } else { str1 = string.Empty; } TraceCore.ThrowingEtwExceptionVerbose(etwDiagnosticTrace2, str3, str1, exception); break; } } }