Пример #1
0
 static public int ConfigAutoReportLogLevel_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
         LogSeverity a1;
         a1 = (LogSeverity)LuaDLL.luaL_checkinteger(l, 1);
         BuglyAgent.ConfigAutoReportLogLevel(a1);
         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
 }
Пример #2
0
    public static void Initialize()
    {
        //---- Enable the debug log print,Release下需要设为false
#if DEBUG
        BuglyAgent.ConfigDebugMode(true);
#else
        BuglyAgent.ConfigDebugMode(false);
#endif

        //---- 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);

        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Bugly init complete, time: {0}", System.DateTime.Now);
        //Debug.Log(HobaString.Format("Bugly init complete, time: {0}, verion: v{1}", System.DateTime.Now, BuglyAgent.PluginVersion));
    }
Пример #3
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);
    }
Пример #4
0
 public static void SetAutoReportLogLevel(int level)
 {
     try
     {
         if (level == 5) //BuglyLogLevelVerbose
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.Log);
         }
         else if (level == 4) //BuglyLogLevelDebug
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogDebug);
         }
         else if (level == 3) //BuglyLogLevelInfo
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogInfo);
         }
         else if (level == 2) //BuglyLogLevelWarn
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogWarning);
         }
         else if (level == 1) //BuglyLogLevelError
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
         }
         else if (level == 0) //BuglyLogLevelSilent
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
             BuglyAgent.ConfigDebugMode(false);
         }
     }
     catch (Exception ex)
     {
         MSDKLog.LogError("SetAutoReportLogLevel with unknown error = \n" + ex.Message + "\n" + ex.StackTrace);
     }
 }
Пример #5
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();
        }
Пример #6
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
    }
Пример #7
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();
 }
Пример #8
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();
 }
Пример #9
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);
 }
Пример #10
0
    public void Init()
    {
        BuglyAgent.ConfigDebugMode(true);
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogWarning);
        BuglyAgent.ConfigDefault(channel, "", "", 0);
        BuglyAgent.InitWithAppId(appId);//初始化


        // BuglyAgent.SetUserId(Config.UserId);

        BuglyAgent.EnableExceptionHandler();//启动异常上报
    }
Пример #11
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);
 }
Пример #12
0
    private void Awake()
    {
        BuglyAgent.EnableExceptionHandler();

        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);

        BuglyAgent.RegisterLogCallback(OnBuglyLogCallback);

        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        Application.targetFrameRate = 30;

        EventDispatcher.AddEventListener <bool>(EventConst.ForceToLogin, ForceToLoginView);

        Application.lowMemory += OnLowMemory;
    }
Пример #13
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();
    }
Пример #14
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();
 }
Пример #15
0
        static int _m_ConfigAutoReportLogLevel_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    LogSeverity _level; translator.Get(L, 1, out _level);

                    BuglyAgent.ConfigAutoReportLogLevel(_level);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Пример #16
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);
    }
Пример #17
0
        public void Init()
        {
            string logVersion = "MSDK Unity Version : " + WGPlatform.Version;

            MsdkUtil.Log(logVersion);
            WGPlatform.Instance.WGBuglyLog(eBuglyLogLevel.eBuglyLogLevel_D, logVersion);

            MessageCenter.Instance.Init();
            WGPlatform.Instance.WGSetPermission(ePermission.eOPEN_ALL);
            BuglyAgent.ConfigCrashReporter(2, 4);
            // NOT Required. Enable debug log print, please set false for release version
            BuglyAgent.ConfigDebugMode(false);
            // Setting report level
            BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
            // 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();
            // NOT Required. If you need to report extra data with exception, you can set the extra handler
            // 只在iOS的C#异常时会触发
            //BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);
        }
Пример #18
0
 public void EnableExceptionHandler(LogSeverity level)
 {
     BuglyAgent.EnableExceptionHandler();
     BuglyAgent.ConfigAutoReportLogLevel(level);
 }
Пример #19
0
    IEnumerator InitVersionAndBugly()
    {
        sr.AdjustResolution();
        sr.setDesignContentScale();
        //Util.AutoAdjustCameraRect(UICamera.mainCamera);
        Debug.Log(string.Format("Resolution: {0}", Screen.currentResolution));
        yield return(Yielders.GetWaitForSeconds(0.1f));

        string versionFile = string.Format("{0}{1}/version.txt", Util.AppContentPath(), LuaConst.osDir);

        Debug.Log(versionFile);
        string version = string.Empty;

        if (Application.isMobilePlatform && Application.platform == RuntimePlatform.Android)
        {
            WWW www = new WWW(versionFile);
            yield return(www);

            if (www.error != null)
            {
                Debug.LogError(www.error);
                version = Application.version;
            }
            else
            {
                version = www.text;
            }
            www.Dispose();
            Debug.Log(string.Format("package version: {0}", version));
        }
        else
        {
            if (File.Exists(versionFile))
            {
                version = File.ReadAllText(versionFile);
            }
            else
            {
                version = Application.version;
            }
        }
        GameManager.packVersion = GameVersion.CreateVersion(version);
        string localVersionFile = Path.Combine(Util.DataPath, "version.txt");

        GameManager.localVersion = GameVersion.CreateVersion(localVersionFile, GameManager.packVersion.ToString());

#if UNITY_EDITOR
        //BuglyAgent.ConfigDebugMode(true);
#else
        //BuglyAgent.ConfigDebugMode(false);
#endif
#if UNITY_IOS
        BuglyAgent.InitWithAppId("1ce5a132bc");
#elif UNITY_ANDROID
        //BuglyAgent.InitWithAppId("529dceaf06");
#endif
        BuglyAgent.SetUserId(string.Format("{0}:{1}", SystemInfo.deviceModel, SystemInfo.deviceName));
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogAssert);
        BuglyAgent.EnableExceptionHandler();

        InitOtherSetting();
        yield return(Yielders.GetWaitForSeconds(2f));

        SceneManager.LoadScene("UpdateScene");
    }