Beispiel #1
0
    private static void NotifySafely(string errorClass, string message, Severity severity, string context, string stackTrace, LogType?type, string severityReason)
    {
        if (errorClass == null)
        {
            errorClass = "Error";
        }

        if (message == null)
        {
            message = "";
        }

        if (context == null)
        {
            context = "";
        }

        if (stackTrace == null)
        {
            return;
        }

        string logType = "";

        if (type != null)
        {
            logType = type.ToString();
        }

        NativeBugsnag.Notify(errorClass, message, SeverityValues[(int)severity], context, stackTrace, logType, severityReason);
    }
    private static void NotifySafely(string errorClass, string message, string severity, string context, string stackTrace)
    {
        if (errorClass == null)
        {
            errorClass = "Error";
        }

        if (message == null)
        {
            message = "";
        }

        if (severity == null)
        {
            severity = "error";
        }

        if (context == null)
        {
            context = "";
        }

        if (stackTrace == null)
        {
            return;
        }

        NativeBugsnag.Notify(errorClass, message, severity, context, stackTrace);
    }
Beispiel #3
0
    private void InitInternal(string apiKey)
    {
        BugsnagApiKey = apiKey;
        NativeBugsnag.Register(BugsnagApiKey, TrackAppSessions || TrackAppSessionsStatic);

        if (BugsnagReleaseStageStatic != null)
        {
            Bugsnag.ReleaseStage = BugsnagReleaseStageStatic;
        }
        else if (Debug.isDebugBuild)
        {
            Bugsnag.ReleaseStage = "development";
        }
        else
        {
            Bugsnag.ReleaseStage = "production";
        }

        Bugsnag.Context = GetLevelName();
        NativeBugsnag.SetAutoNotify(AutoNotify);
        NativeBugsnag.AddToTab("Unity", "unityException", "false");
        NativeBugsnag.AddToTab("Unity", "unityVersion", Application.unityVersion.ToString());
        NativeBugsnag.AddToTab("Unity", "platform", Application.platform.ToString());
        NativeBugsnag.AddToTab("Unity", "osLanguage", Application.systemLanguage.ToString());
#if UNITY_5_OR_NEWER
#if UNITY_5_6_OR_NEWER
        NativeBugsnag.AddToTab("Unity", "bundleIdentifier", Application.identifier.ToString());
#else
        NativeBugsnag.AddToTab("Unity", "bundleIdentifier", Application.bundleIdentifier.ToString());
#endif
        NativeBugsnag.AddToTab("Unity", "version", Application.version.ToString());
        NativeBugsnag.AddToTab("Unity", "companyName", Application.companyName.ToString());
        NativeBugsnag.AddToTab("Unity", "productName", Application.productName.ToString());
#endif
    }
Beispiel #4
0
    void Awake()
    {
        DontDestroyOnLoad(this);
        NativeBugsnag.Register(BugsnagApiKey);

        if (Debug.isDebugBuild)
        {
            Bugsnag.ReleaseStage = "development";
        }
        else
        {
            Bugsnag.ReleaseStage = "production";
        }

        Bugsnag.Context = GetLevelName();
        NativeBugsnag.SetAutoNotify(AutoNotify);
        NativeBugsnag.AddToTab("Unity", "unityVersion", Application.unityVersion.ToString());
        NativeBugsnag.AddToTab("Unity", "platform", Application.platform.ToString());
        NativeBugsnag.AddToTab("Unity", "osLanguage", Application.systemLanguage.ToString());
#if UNITY_5_OR_NEWER
        NativeBugsnag.AddToTab("Unity", "bundleIdentifier", Application.bundleIdentifier.ToString());
        NativeBugsnag.AddToTab("Unity", "version", Application.version.ToString());
        NativeBugsnag.AddToTab("Unity", "companyName", Application.companyName.ToString());
        NativeBugsnag.AddToTab("Unity", "productName", Application.productName.ToString());
#endif
    }
 public static void LeaveBreadcrumb(string breadcrumb)
 {
     if (breadcrumb == null)
     {
         return;
     }
     NativeBugsnag.LeaveBreadcrumb(breadcrumb);
 }
 public static void ClearTab(string tabName)
 {
     if (tabName == null)
     {
         return;
     }
     NativeBugsnag.ClearTab(tabName);
 }
 public static void AddToTab(string tabName, string attributeName, string attributeValue) {
     if (tabName == null || attributeName == null) {
         return;
     }
     if (attributeValue == null) {
         attributeValue = "null";
     }
     NativeBugsnag.AddToTab(tabName, attributeName, attributeValue);
 }
    public static void SetUser(string userId, string userName, string userEmail) {
        if (userId == null) {
            userId = "[unknown]";
        }

        if (userName == null) {
            userName = "******";
        }

        if (userEmail == null) {
            userEmail = "[unknown]";
        }

        NativeBugsnag.SetUser(userId, userName, userEmail);
    }
Beispiel #9
0
 public static void StartSession()
 {
     NativeBugsnag.StartSession();
 }