private void OnRollbarInternalEvent(object sender, RollbarEventArgs e) { Console.WriteLine(e.TraceAsString()); Trace.WriteLine(e.TraceAsString()); switch (e) { case RollbarApiErrorEventArgs apiErrorEvent: this.ApiErrorEvents.Add(apiErrorEvent); return; case CommunicationEventArgs commEvent: this.CommunicationEvents.Add(commEvent); return; case CommunicationErrorEventArgs commErrorEvent: this.CommunicationErrorEvents.Add(commErrorEvent); return; case InternalErrorEventArgs internalErrorEvent: this.InternalSdkErrorEvents.Add(internalErrorEvent); return; default: Assert.Fail("Unexpected RollbarEventArgs specialization type!"); return; } }
/// <summary> /// Handles the <see cref="E:RollbarInternalEvent" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="RollbarEventArgs"/> instance containing the event data.</param> private void OnRollbarInternalEvent(object sender, RollbarEventArgs e) { //// for basic RollbarRateLimitVerification test: //switch (e) //{ // case RollbarApiErrorEventArgs apiErrorEvent: // //this.ApiErrorEvents.Add(apiErrorEvent); // return; // case CommunicationEventArgs commEvent: // Console.WriteLine(commEvent.EventTimestamp + " SENT: "); // return; // case CommunicationErrorEventArgs commErrorEvent: // //this.CommunicationErrorEvents.Add(commErrorEvent); // return; // case InternalErrorEventArgs internalErrorEvent: // //this.InternalSdkErrorEvents.Add(internalErrorEvent); // return; // case PayloadDropEventArgs payloadDropEvent: // Console.WriteLine(payloadDropEvent.EventTimestamp + " DROP: " + payloadDropEvent.Reason); // return; // default: // //Assert.Fail("Unexpected RollbarEventArgs specialization type!"); // return; //} Console.WriteLine(e.TraceAsString()); Trace.WriteLine(e.TraceAsString()); this.Register(e); }
private static void OnRollbarInternalEvent(object sender, RollbarEventArgs e) { Console.WriteLine(e.TraceAsString()); RollbarApiErrorEventArgs apiErrorEvent = e as RollbarApiErrorEventArgs; if (apiErrorEvent != null) { //TODO: handle/report Rollbar API communication error event... return; } CommunicationEventArgs commEvent = e as CommunicationEventArgs; if (commEvent != null) { //TODO: handle/report Rollbar API communication event... return; } CommunicationErrorEventArgs commErrorEvent = e as CommunicationErrorEventArgs; if (commErrorEvent != null) { //TODO: handle/report basic communication error while attempting to reach Rollbar API service... return; } InternalErrorEventArgs internalErrorEvent = e as InternalErrorEventArgs; if (internalErrorEvent != null) { //TODO: handle/report basic internal error while using the Rollbar Notifier... return; } }
internal void OnRollbarEvent(RollbarEventArgs e) { Assumption.AssertNotNull(this._config, nameof(this._config)); Assumption.AssertNotNull(e, nameof(e)); EventHandler <RollbarEventArgs>?handler = InternalEvent; if (handler != null) { handler(this, e); } (e.Logger as RollbarLogger)?.OnRollbarEvent(e); const string category = nameof(this.OnRollbarEvent); const int id = 0; switch (e) { case InternalErrorEventArgs internalErrorEvent: traceSource.TraceData(TraceEventType.Critical, id, category, e.TraceAsString()); break; case CommunicationErrorEventArgs commErrorEvent: case RollbarApiErrorEventArgs apiErrorEvent: traceSource.TraceData(TraceEventType.Error, id, category, e.TraceAsString()); break; case CommunicationEventArgs commEvent: transmittedPayloadsTraceSource.TraceData(TraceEventType.Information, id, e.Payload); traceSource.TraceData(TraceEventType.Information, id, category, e.TraceAsString()); break; case TransmissionOmittedEventArgs transmissionOmittedEvent: omittedPayloadsTraceSource.TraceData(TraceEventType.Information, id, e.Payload); traceSource.TraceData(TraceEventType.Warning, id, category, e.TraceAsString()); break; case PayloadDropEventArgs payloadDropEvent: default: traceSource.TraceData(TraceEventType.Warning, id, category, e.TraceAsString()); break; } traceSource.Flush(); }
private void Instance_InternalEvent(object sender, RollbarEventArgs e) { string eventTrace = $"##################{Environment.NewLine}{e.TraceAsString()}{Environment.NewLine}"; Console.WriteLine(eventTrace); System.Diagnostics.Trace.WriteLine(eventTrace); //CommunicationEventArgs communicationEventArgs = e as CommunicationEventArgs; //if (communicationEventArgs != null) //{ // this._rollbarCommEvents.Add(communicationEventArgs); //} //CommunicationErrorEventArgs communicationErrorEventArgs = e as CommunicationErrorEventArgs; //if (communicationErrorEventArgs != null) //{ // this._rollbarCommErrorEvents.Add(communicationErrorEventArgs); //} }