예제 #1
0
 static public int RegisterLogCallback_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
         BuglyAgent.LogCallbackDelegate a1;
         checkDelegate(l, 1, out a1);
         BuglyAgent.RegisterLogCallback(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
        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
    void Awake()
    {
        luaenv = new LuaEnv();
        gameObject.AddComponent <OutLog>();
        Mono = gameObject.AddComponent <emptyMono>();
        Application.targetFrameRate = AppConst.lockFrame;
#if ISDEBUG
        //gameObject.AddComponent<TestConsole>();
        m_LastUpdateShowTime = Time.realtimeSinceStartup;
#endif

        #region bugly
        //开启SDK的日志打印,发布版本请务必关闭
#if ISDEBUG
        BuglyAgent.ConfigDebugMode(true);
#else
        BuglyAgent.ConfigDebugMode(false);
#endif
        //注册日志回调,替换使用'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        BuglyAgent.RegisterLogCallback(OutLog.HandleLog);

#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("Your App ID");
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("7599ce92e1");
#endif
        //如果你确认已在对应的ios工程或Andoird工程初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
        #endregion

        EventManager.instance.RegistEvent(NetEventType.OnSetUpdateWindowTipTxt, SetUpdateTipText);
    }
예제 #4
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);
    }
예제 #5
0
    public void InitBuglyAgent()
    {
        string AppKey_ios;
        string AppKey_Android;

        if (DebugConfigController.Instance.FormalData)
        {
            AppKey_Android = ConfigurationController.Instance.BuglyAppKey_AndroidFormal;
            AppKey_ios     = ConfigurationController.Instance.BuglyAppKey_iosFormal;
        }
        else
        {
            AppKey_Android = ConfigurationController.Instance.BuglyAppKey_AndroidTest;
            AppKey_ios     = ConfigurationController.Instance.BuglyAppKey_iosTest;
        }
        // 开启SDK的日志打印,发布版本请务必关闭
        BuglyAgent.ConfigDebugMode(false);
        // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        if (DebugConfigController.Instance._Debug)
        {
            BuglyAgent.RegisterLogCallback(LogCallback);
        }


#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId(AppKey_ios);
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId(AppKey_Android);
#endif

        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();

        //Application.logMessageReceivedThreaded += LogCallback;
    }
예제 #6
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);
 }
예제 #7
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();
 }
예제 #8
0
 private void Awake()
 {
     UnityEngine.Object.DontDestroyOnLoad(this);
     this.outpath = Application.persistentDataPath + "/outLog.txt";
     if (File.Exists(this.outpath))
     {
         File.Delete(this.outpath);
     }
     BuglyAgent.RegisterLogCallback(new BuglyAgent.LogCallbackDelegate(this.HandleLog));
 }
예제 #9
0
    //static List<string> mLines = new List<string>();
    //static List<string> mWriteTxt = new List<string>();
    //private string outpath;

    void Awake()
    {
        DontDestroyOnLoad(this);
        //outpath = Application.persistentDataPath + "/outLog.txt";
        ////每次启动客户端删除之前保存的Log
        //if (System.IO.File.Exists(outpath))
        //{
        //    File.Delete(outpath);
        //}
        //在这里做一个Log的监听
        BuglyAgent.RegisterLogCallback(HandleLog);
    }
예제 #10
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);
 }
예제 #11
0
 public void RegisterLogCallback(ApolloBuglyLogDelegate callback)
 {
     ADebug.Log("Apollo RegisterExceptionHandler");
     if (callback != null)
     {
         this.m_LogCallback = callback;
         BuglyAgent.RegisterLogCallback(new BuglyAgent.LogCallbackDelegate(this.apollo_bugly_log_callback));
     }
     else
     {
         BuglyAgent.RegisterLogCallback(null);
     }
 }
예제 #12
0
        private void InitBugly()
        {
            // 开启SDK的日志打印,发布版本请务必关闭
            BuglyAgent.ConfigDebugMode(Debug.isDebugBuild);
            BuglyAgent.InitWithAppId(GameApp.Options.BuglyAppID);
            BuglyAgent.SetScene(Application.loadedLevel);
            BuglyAgent.SetUserId(Application.companyName + "." + Application.productName);

            if (GameApp.Options.EnableLog2File)
            {
                BuglyAgent.RegisterLogCallback(Application_logMessageReceived);
                RemoteOldFile();
            }
        }
예제 #13
0
파일: Main.cs 프로젝트: linxscc/LoveGame
    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;
    }
예제 #14
0
    void InitBuglySDK()
    {
        // enable debug log print
        BuglyAgent.ConfigDebugMode(true);
        // Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        BuglyAgent.RegisterLogCallback(CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("900001055");
                #elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("900001191");
                #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();
    }
예제 #15
0
    // Use this for initialization
    void Awake()
    {
        Application.targetFrameRate = 60;
        var external = External.Instance;

        // 事件监听
        registerEvents();

        debugSetup();

        BuglyAgent.RegisterLogCallback(CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
                #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("b3d868488f");
                #endif

        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
    }
예제 #16
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();
        }
예제 #17
0
    public LogMgr()
    {
#if UNITY_EDITOR
        outpath = Application.dataPath + "/outLog.txt";
#else
        outpath = Application.persistentDataPath + "/outLog.txt";
#endif
        bool error = false;
        do
        {
            if (System.IO.File.Exists(outpath))
            {
                try
                {
                    File.Delete(outpath);
                }
                catch (Exception)
                {
                    error   = true;
                    outpath = outpath.Replace("outLog", "outLog~");
                }
            }
            else
            {
                error = false;
            }
        } while (error);

        //Unity5里允许多重监听了,所以真机模式没有必要用BuglyAgent.RegisterLogCallback了
        //unity5以下才用BuglyAgent.RegisterLogCallback
        //用真机模式下用logMessageReceivedThreaded是因为logMessageReceived在真机模式下没有堆栈信息
#if UNITY_EDITOR
        Application.logMessageReceived += OnLog;
#else
#if UNITY_5
        //
        Application.logMessageReceivedThreaded += OnLog;
#else
        BuglyAgent.RegisterLogCallback(OnLog);
#endif
#endif
    }
예제 #18
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();
 }
예제 #19
0
        static int _m_RegisterLogCallback_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    BuglyAgent.LogCallbackDelegate _handler = translator.GetDelegate <BuglyAgent.LogCallbackDelegate>(L, 1);

                    BuglyAgent.RegisterLogCallback(_handler);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #20
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);
    }
        void Awake()
        {
            BatteryUtils.init();
            FlurryUtil.Init();
            AsyncActionHelper.Instance.init();
            FlurryUtil.SetUserId(CupBuild.getCupSn());
            FlurryUtil.LogEvent("Hank_Splashscreen_View");
            Screen.sleepTimeout = SleepTimeout.NeverSleep;
            GameObject objGlobalContextView = null; /*= GameObject.Find("GlobalContextView");
                                                     * if (objGlobalContextView == null)*/

            {
                objGlobalContextView      = new GameObject();
                objGlobalContextView.name = "GlobalContextView";
                GlobalContextView globalContextView = objGlobalContextView.AddComponent <GlobalContextView>();
                GameObject.DontDestroyOnLoad(globalContextView);
            }
#if (UNITY_IOS || UNITY_ANDROID) && (!UNITY_EDITOR)
#if WETEST_SDK
            objGlobalContextView.AddComponent <WeTest.U3DAutomation.U3DAutomationBehaviour>();
            BuglyAgent.RegisterLogCallback(WeTest.U3DAutomation.CrashMonitor._OnLogCallbackHandler);
#endif
#endif
        }
예제 #22
0
 void Awake()
 {
     gameObject.AddComponent <BuglyInit>();
     BuglyAgent.RegisterLogCallback(LogCallback);
 }