상속: MonoBehaviour
예제 #1
0
 public static Bugsnag createBugsnagInstance(GameObject gameObject, String ApiKey, bool autoCaptureSessions) {
     Bugsnag.SetApiKey(ApiKey);
     Bugsnag.SetAutoCaptureSessions(autoCaptureSessions);
     Bugsnag bugsnagInstance = gameObject.AddComponent<Bugsnag>();
     bugsnagInstance.Init();
     return bugsnagInstance;
 }
예제 #2
0
    IEnumerator NotifyTwiceCoroutine()
    {
        Bugsnag.Notify(new System.Exception("Rollback failed"));
        yield return(new WaitForSeconds(1));

        Bugsnag.Notify(new ExecutionEngineException("Invalid runtime"));
    }
 public void OnNotifyClick()
 {
     Bugsnag.Context = "NotifyClocked";
     Debug.Log("Notify clicked");
     Bugsnag.Notify(new System.Exception("Notify clicked!"), "NotifyClacked");
     Bugsnag.Context = null;
 }
예제 #4
0
 void LeaveComplexBreadcrumbAndNotify()
 {
     Bugsnag.LeaveBreadcrumb("Reload", BreadcrumbType.Navigation, new Dictionary <string, string>()
     {
         { "preload", "launch" }
     });
     Bugsnag.Notify(new System.Exception("Collective failure"));
 }
예제 #5
0
    public static Bugsnag createBugsnagInstance(GameObject gameObject, String ApiKey)
    {
        Bugsnag.SetApiKey(ApiKey);
        Bugsnag bugsnagInstance = gameObject.AddComponent <Bugsnag>();

        bugsnagInstance.Init();
        return(bugsnagInstance);
    }
 public void OnDivideByZeroClick()
 {
     Debug.Log("Divide By Zero clicked");
     try {
         int a = 0;
         int b = 1;
         int c = b / a;
     } catch (System.Exception e) {
         Bugsnag.Notify(e);
     }
 }
예제 #7
0
    void RunResumedSession()
    {
        // send 1st exception which should include session info
        Bugsnag.StartSession();
        Bugsnag.Notify(new System.Exception("First Error"));

        // send 2nd exception after resuming a session
        Bugsnag.StopSession();
        Bugsnag.ResumeSession();
        Bugsnag.Notify(new System.Exception("Second Error"));
    }
예제 #8
0
 void DoNotifyWithCallback()
 {
     Bugsnag.Notify(new System.Exception("blorb"), report => {
         report.Exceptions[0].ErrorClass   = "FunnyBusiness";
         report.Exceptions[0].ErrorMessage = "cake";
         report.Metadata.Add("shape", new Dictionary <string, string>()
         {
             { "arc", "yes" },
         });
     });
 }
 // Use this for initialization
 void Start()
 {
     Bugsnag.Context      = null;
     Bugsnag.ReleaseStage = null;
     Bugsnag.AddToTab(null, null, null);
     Bugsnag.AddToTab("My Data", "myKey", "myValue");
     Bugsnag.ClearTab(null);
     Bugsnag.SetUser("user-id", "User Name", "*****@*****.**");
     Bugsnag.ReleaseStage = "staging";
     Bugsnag.AppVersion   = "1.2.3-alpha";
     Bugsnag.NotifyLevel  = Bugsnag.LogSeverity.Warning;
 }
예제 #10
0
    void RunNewSession()
    {
        // send 1st exception which should include session info
        Bugsnag.StartSession();
        Bugsnag.Notify(new System.Exception("First Error"));

        // stop tracking the existing session
        Bugsnag.StopSession();
        Bugsnag.StartSession();

        // send 2nd exception which should contain new session info
        Bugsnag.Notify(new System.Exception("Second Error"));
    }
 // Use this for initialization
 void Start()
 {
     Bugsnag.Context      = null;
     Bugsnag.ReleaseStage = null;
     Bugsnag.AddToTab(null, null, null);
     Bugsnag.AddToTab("My Data", "myKey", "myValue");
     Bugsnag.ClearTab(null);
     Bugsnag.SetUser("user-id", "User Name", "*****@*****.**");
     Bugsnag.ReleaseStage = "staging";
     Bugsnag.AppVersion   = "1.2.3-alpha";
     Bugsnag.NotifyLevel  = Bugsnag.LogSeverity.Warning;
     Bugsnag.SessionUrl   = "http://127.0.0.1:8092";
     Bugsnag.StartSession();
     Bugsnag.SetAutoCaptureSessions(true);
 }
예제 #12
0
 public static void NotifyBugsnag(Exception e, Bugsnag.Metadata metadata)
 {
     try
     {
         if (null == metadata)
         {
             metadata = new Bugsnag.Metadata();
         }
         metadata.AddToTab("Details", "OSVersion", Environment.OSVersion.ToString());
         metadata.AddToTab("Details", "applicationVersion", Application.ProductVersion);
         bugsnag.Notify(e, metadata);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Could not notify bugsnag: ", ex);
     }
 }
예제 #13
0
    void LoadScenario()
    {
        var scenario = Environment.GetEnvironmentVariable("BUGSNAG_SCENARIO");

        switch (scenario)
        {
        case "DebugLogBreadcrumbNotify":
            LogLowLevelMessageAndNotify();
            break;

        case "ComplexBreadcrumbNotify":
            LeaveComplexBreadcrumbAndNotify();
            break;

        case "DoubleNotify":
            NotifyTwice();
            break;

        case "MessageBreadcrumbNotify":
            LeaveMessageBreadcrumbAndNotify();
            break;

        case "Notify":
            DoNotify();
            break;

        case "LogUnthrown":
            DoLogUnthrown();
            break;

        case "UncaughtException":
            DoUnhandledException(0);
            break;

        case "AssertionFailure":
            MakeAssertionFailure(4);
            break;

        case "UncaughtExceptionAsUnhandled":
            UncaughtExceptionAsUnhandled();
            break;

        case "LogUnthrownAsUnhandled":
            DoLogUnthrownAsUnhandled();
            break;

        case "ReportLoggedWarning":
            DoLogWarning();
            break;

        case "ReportLoggedWarningWithHandledConfig":
            DoLogWarningWithHandledConfig();
            break;

        case "ManualSession":
            Bugsnag.StartSession();
            break;

        case "ManualSessionCrash":
            Bugsnag.StartSession();
            UncaughtExceptionAsUnhandled();
            break;

        case "ManualSessionNotify":
            Bugsnag.StartSession();
            DoNotify();
            break;

        case "ManualSessionMixedEvents":
            Bugsnag.StartSession();
            DoNotify();
            DoLogWarning();
            UncaughtExceptionAsUnhandled();
            break;
        }
    }
예제 #14
0
 void DoNotify()
 {
     Bugsnag.Notify(new System.Exception("blorb"));
 }
예제 #15
0
 void LogLowLevelMessageAndNotify()
 {
     Debug.LogWarning("Failed to validate credentials");
     Bugsnag.Notify(new ExecutionEngineException("Invalid runtime"));
 }
예제 #16
0
 void LeaveMessageBreadcrumbAndNotify()
 {
     Bugsnag.LeaveBreadcrumb("Initialize bumpers");
     Bugsnag.Notify(new System.Exception("Collective failure"));
 }
예제 #17
0
    void LoadScenario()
    {
        var scenario = Environment.GetEnvironmentVariable("BUGSNAG_SCENARIO");

        switch (scenario)
        {
        case "LogExceptionOutsideNotifyReleaseStages":
            Bugsnag.Configuration.ReleaseStage        = "dev";
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "production" };
            DoLogUnthrown();
            break;

        case "NotifyOutsideNotifyReleaseStages":
            Bugsnag.Configuration.ReleaseStage        = "dev";
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "production" };
            DoNotify();
            break;

        case "NativeCrashOutsideNotifyReleaseStages":
            Bugsnag.Configuration.ReleaseStage        = "dev";
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "production" };
            crashy_signal_runner(8);
            break;

        case "UncaughtExceptionOutsideNotifyReleaseStages":
            Bugsnag.Configuration.ReleaseStage        = "dev";
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "production" };
            DoUnhandledException(0);
            break;

        case "DebugLogBreadcrumbNotify":
            LogLowLevelMessageAndNotify();
            break;

        case "ComplexBreadcrumbNotify":
            LeaveComplexBreadcrumbAndNotify();
            break;

        case "DoubleNotify":
            NotifyTwice();
            break;

        case "MessageBreadcrumbNotify":
            LeaveMessageBreadcrumbAndNotify();
            break;

        case "Notify":
            DoNotify();
            break;

        case "NotifyBackground":
            new System.Threading.Thread(() => DoNotify()).Start();
            break;

        case "NotifyCallback":
            DoNotifyWithCallback();
            break;

        case "NotifySeverity":
            DoNotifyWithSeverity();
            break;

        case "LogUnthrown":
            DoLogUnthrown();
            break;

        case "UncaughtException":
            DoUnhandledException(0);
            break;

        case "AssertionFailure":
            MakeAssertionFailure(4);
            break;

        case "UncaughtExceptionAsUnhandled":
            UncaughtExceptionAsUnhandled();
            break;

        case "LogUnthrownAsUnhandled":
            DoLogUnthrownAsUnhandled();
            break;

        case "ReportLoggedWarningThreaded":
            new System.Threading.Thread(() => DoLogWarning()).Start();
            break;

        case "ReportLoggedWarning":
            DoLogWarning();
            break;

        case "ReportLoggedError":
            DoLogError();
            break;

        case "ReportLoggedWarningWithHandledConfig":
            DoLogWarningWithHandledConfig();
            break;

        case "ManualSession":
            Bugsnag.StartSession();
            break;

        case "ManualSessionCrash":
            Bugsnag.StartSession();
            UncaughtExceptionAsUnhandled();
            break;

        case "ManualSessionNotify":
            Bugsnag.StartSession();
            DoNotify();
            break;

        case "AutoSessionInNotifyReleaseStages":
            Bugsnag.Configuration.ReleaseStage        = "production";
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "production" };
            break;

        case "ManualSessionInNotifyReleaseStages":
            Bugsnag.Configuration.ReleaseStage        = "production";
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "production" };
            Bugsnag.StartSession();
            break;

        case "AutoSessionNotInNotifyReleaseStages":
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "no-op" };
            break;

        case "ManualSessionNotInNotifyReleaseStages":
            Bugsnag.Configuration.NotifyReleaseStages = new [] { "no-op" };
            Bugsnag.StartSession();
            break;

        case "ManualSessionMixedEvents":
            Bugsnag.StartSession();
            DoNotify();
            DoLogWarning();
            UncaughtExceptionAsUnhandled();
            break;

        case "StoppedSession":
            Bugsnag.StartSession();
            Bugsnag.StopSession();
            DoNotify();
            break;

        case "ResumedSession":
            RunResumedSession();
            break;

        case "NewSession":
            RunNewSession();
            break;

        case "NativeCrash":
            crashy_signal_runner(8);
            break;

        case "UncaughtExceptionWithoutAutoNotify":
            Bugsnag.Configuration.AutoNotify = false;
            DoUnhandledException(0);
            break;

        case "NotifyWithoutAutoNotify":
            Bugsnag.Configuration.AutoNotify = false;
            DoNotify();
            break;

        case "LoggedExceptionWithoutAutoNotify":
            Bugsnag.Configuration.AutoNotify = false;
            DoLogUnthrownAsUnhandled();
            break;

        case "NativeCrashWithoutAutoNotify":
            Bugsnag.Configuration.AutoNotify = false;
            crashy_signal_runner(8);
            break;

        case "NativeCrashReEnableAutoNotify":
            Bugsnag.Configuration.AutoNotify = false;
            Bugsnag.Configuration.AutoNotify = true;
            crashy_signal_runner(8);
            break;

        case "AutoSessionNativeCrash":
            new Thread(() => {
                Thread.Sleep(900);
                crashy_signal_runner(8);
            }).Start();
            break;
        }
    }
예제 #18
0
 void DoNotifyWithSeverity()
 {
     Bugsnag.Notify(new System.Exception("blorb"), Severity.Info);
 }