예제 #1
0
    void Awake()
    {
        // Enable the debug log print
        BuglyAgent.ConfigDebugMode(false);
        // Config default channel, version, user
        BuglyAgent.ConfigDefault(null, null, null, 0);
        // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
        // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
        BuglyAgent.ConfigAutoQuitApplication(false);
        // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
        BuglyAgent.RegisterLogCallback(null);

        // Init the bugly sdk and enable the c# exception handler.
        BuglyAgent.InitWithAppId(BuglyAppID);

        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
        BuglyAgent.SetLogCallbackExtrasHandler(MyLogCallbackExtrasHandler);

        Destroy(this);
    }
예제 #2
0
        static void InitBugly()
        {
            if (Application.isEditor)
            {
                return;
            }

            // Enable the debug log print
            BuglyAgent.ConfigDebugMode(enable: Config.enableDebug);
            // Config default channel, version, user
            BuglyAgent.ConfigDefault(channel: Config.store, $"{Config.versionName}-{Config.versionCode}",
                                     user: UserInfoManager.getUserInfo().userId ?? "anonymous", 0);
            // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
            BuglyAgent.ConfigAutoReportLogLevel(level: LogSeverity.LogWarning);
            // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
            BuglyAgent.ConfigAutoQuitApplication(false);
            // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
            BuglyAgent.RegisterLogCallback(null);

            // Init the bugly sdk and enable the c# exception handler.
            BuglyAgent.InitWithAppId(appId: Config.buglyId);

            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
        }
예제 #3
0
    /// <summary>
    /// 初始化bugly
    /// </summary>
    public void InitBuglySDK()
    {
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS
        // TODO NOT Required. Set the crash reporter type and log to report
        // BuglyAgent.ConfigCrashReporter (1, 2);

        // TODO NOT Required. Enable debug log print, please set false for release version
#if DEBUG
        BuglyAgent.ConfigDebugMode(true);
#endif
        //BuglyAgent.ConfigDebugMode(true);
        // TODO NOT Required. Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

        // BuglyAgent.ConfigDefault ("Bugly", null, "ronnie", 0);

#if UNITY_IPHONE || UNITY_IOS
        if (Const.Region == RegionType.CHINA)
        {
            var channel = string.Format("{0}_{1}", GlobalConfig.Instance.Channel, GlobalConfig.Instance.SubChannel);

            BuglyAgent.ConfigDefault(channel, null, null, 0);
            BuglyAgent.InitWithAppId("d47e3e83c9");
        }
        else if (Const.Region == RegionType.HKTW)
        {
            BuglyAgent.InitWithAppId("af2d9108c7");
        }
        else if (Const.Region == RegionType.KOREA)
        {
            BuglyAgent.InitWithAppId("c5ab48ff08");
        }
        else if (Const.Region == RegionType.SEASIA)
        {
            BuglyAgent.InitWithAppId("9baaf461f1");
        }
        // iOS工程启动初始化
#elif UNITY_ANDROID
        // BuglyAgent.InitWithAppId ("900036622");
        // android工程启动初始化
#endif

        //BuglyAgent.SetUserId();
        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // If you need to report extra data with exception, you can set the extra handler
        //BuglyAgent.SetLogCallbackExtrasHandler(LogCallbackExtrasHandler);



        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Init the bugly sdk");
        LogExtraInfo();
#endif
    }
예제 #4
0
 private void InitBugly()
 {
     BuglyAgent.ConfigDebugMode(SystemConfig.IsBuglySDKLogOn);
     BuglyAgent.ConfigDefault(SDKManager.Instance.GetSDKName(), this.GetLocalVersionsString(), SystemInfoTools.GetDeviceName(), 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.InitWithAppId("900057844");
     BuglyAgent.EnableExceptionHandler();
 }
예제 #5
0
 private void Awake()
 {
     BuglyAgent.ConfigDebugMode(false);
     BuglyAgent.ConfigDefault(null, null, null, 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.RegisterLogCallback(null);
     BuglyAgent.InitWithAppId("YOUR APP ID GOES HERE");
     Object.Destroy(this);
 }
예제 #6
0
 private static void Bugly_Init()
 {
     BuglyAgent.ConfigDebugMode(false);
     BuglyAgent.ConfigDefault(null, null, null, 0L);
     BuglyAgent.ConfigAutoReportLogLevel(5);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.RegisterLogCallback(null);
     BuglyAgent.InitWithAppId("8c142b9f46");
     BuglyAgent.EnableExceptionHandler();
 }
예제 #7
0
    public void Init()
    {
        BuglyAgent.ConfigDebugMode(true);
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogWarning);
        BuglyAgent.ConfigDefault(channel, "", "", 0);
        BuglyAgent.InitWithAppId(appId);//初始化


        // BuglyAgent.SetUserId(Config.UserId);

        BuglyAgent.EnableExceptionHandler();//启动异常上报
    }
예제 #8
0
 private void Awake()
 {
     BuglyAgent.ConfigDebugMode(false);
     BuglyAgent.ConfigDefault(null, null, null, 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(false);
     BuglyAgent.RegisterLogCallback(null);
     BuglyAgent.InitWithAppId("YOUR APP ID GOES HERE");
     BuglyAgent.EnableExceptionHandler();
     BuglyAgent.SetLogCallbackExtrasHandler(new Func <Dictionary <string, string> >(BuglyInit.MyLogCallbackExtrasHandler));
     UnityEngine.Object.Destroy(this);
 }
예제 #9
0
        public void Awake()
        {
            if (Instance == null)
            {
                Log.Debug("bugly sdk init");
                Instance = this;
                if (Application.isEditor)
                {
                    isRuntime = false;
                    return;
                }
#if DEBUG
                //BuglyAgent.ConfigDebugMode(true);
#endif
                //logcall = RegisterCallBack;
                //BuglyAgent.RegisterLogCallback(logcall);
                BuglyAgent.ConfigDefault(channel, Application.version, Application.productName, 0);

                if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    if (GlobalData.Instance.serverType == 2)
                    {
                        BuglyAgent.InitWithAppId("1bef60b664");//正式服
                    }
                    else if (GlobalData.Instance.serverType == 1)
                    {
                        BuglyAgent.InitWithAppId("809b83eaa2");//测试服
                    }
                }
                else if (Application.platform == RuntimePlatform.Android)
                {
                    if (GlobalData.Instance.serverType == 2)
                    {
                        BuglyAgent.InitWithAppId("b15be2578e");//正式服
                    }
                    else if (GlobalData.Instance.serverType == 1)
                    {
                        BuglyAgent.InitWithAppId("02cceece35");//测试服
                    }
                }
                BuglyAgent.EnableExceptionHandler();
                BuglyAgent.PrintLog(LogSeverity.LogInfo, "bugly sdk init");
            }
        }
예제 #10
0
        public void init(TyCrashReport.initInfo info)
        {
            // enable debug log print
            BuglyAgent.ConfigDebugMode(info._debuglogprint);
            // Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
            //BuglyAgent.RegisterLogCallback(CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
            BuglyAgent.RegisterLogCallback(null);
            BuglyAgent.ConfigDefault(info._channel, info._ver, info._user, 0);

#if UNITY_IPHONE || UNITY_IOS
            BuglyAgent.InitWithAppId(info._appId_IOS);
#elif UNITY_ANDROID
            BuglyAgent.InitWithAppId(info._appId_Android);
#endif

            // If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
        }
예제 #11
0
        static int _m_ConfigDefault_xlua_st_(RealStatePtr L)
        {
            try {
                {
                    string _channel = LuaAPI.lua_tostring(L, 1);
                    string _version = LuaAPI.lua_tostring(L, 2);
                    string _user    = LuaAPI.lua_tostring(L, 3);
                    long   _delay   = LuaAPI.lua_toint64(L, 4);

                    BuglyAgent.ConfigDefault(_channel, _version, _user, _delay);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #12
0
    protected void Awake()
    {
        try {
            string uid = PlayerPrefs.GetString("PlayerPrefs_Login_USERID", "0");
            if (PlayerPrefs.GetInt("PlayerPrefs_OpenDevelopmentMode", 0) != 0)
            {
                uid += "_test";
            }
            BuglyAgent.ConfigDefault("DHQPYX", Application.version, uid, 0);
        } catch (System.Exception ex) {
            Debug.LogException(ex);
        }
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("b84a162675");
                #elif UNITY_ANDROID
//		    BuglyAgent.InitWithAppId ("331505691e");
        BuglyAgent.EnableExceptionHandler();
                #endif

#if !UNITY_EDITOR
        GameConfigProject.instance.assetLoadType = 1;
        GameConfigProject.instance.testView      = false;
#else
        if (GameConfigProject.instance.testView)
        {
            return;
        }
#endif
        GameObject gameRoot = GameObject.Find("GameRoot");
        if (!GameConfigProject.instance.testView && gameRoot != null)
        {
            gameRoot.name = "GameRootNeedDestroy";
            gameRoot.SetActive(false);
            Destroy(gameRoot);
        }
        if (!ClearPersistentExpireAssets())
        {
            ClearPersistentExpireAssets();
        }
        new LuaLoader();
        base.Awake();
    }
예제 #13
0
 private void Awake()
 {
     if (Application.platform == RuntimePlatform.Android && !this.androidEnable)
     {
         return;
     }
     if (Application.platform == RuntimePlatform.IPhonePlayer && !this.iosEnable)
     {
         return;
     }
     BuglyAgent.ConfigCrashReporter(1, 1);
     BuglyAgent.ConfigDebugMode(true);
     BuglyAgent.ConfigDefault(string.Empty, GlobalSettings.Instance.versionConfig.appVersion, "10000", 0L);
     BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
     BuglyAgent.ConfigAutoQuitApplication(true);
     BuglyAgent.RegisterLogCallback(new BuglyAgent.LogCallbackDelegate(CallbackDelegate.Instance.OnApplicationLogCallbackHandler));
     BuglyAgent.InitWithAppId("900016162");
     BuglyAgent.SetScene(3450);
     BuglyAgent.EnableExceptionHandler();
 }
예제 #14
0
    void Awake()
    {
        // Enable the debug log print
        BuglyAgent.ConfigDebugMode(false);
        // Config default channel, version, user
        BuglyAgent.ConfigDefault(null, null, null, 0);
        // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
        // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
        BuglyAgent.ConfigAutoQuitApplication(false);
        // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
        BuglyAgent.RegisterLogCallback(null);

        // Init the bugly sdk and enable the c# exception handler.
        BuglyAgent.InitWithAppId(BuglyAppID);

        // If you has init the sdk in Android or iOS project, please comment last line and uncomment follow method to enable c# exception handler only:
        // BuglyAgent.EnableExceptionHandler ();

        Destroy(this);
    }
예제 #15
0
 static public int ConfigDefault_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         System.String a1;
         checkType(l, 1, out a1);
         System.String a2;
         checkType(l, 2, out a2);
         System.String a3;
         checkType(l, 3, out a3);
         System.Int64 a4;
         checkType(l, 4, out a4);
         BuglyAgent.ConfigDefault(a1, a2, a3, a4);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }