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); }
static public int SetLogCallbackExtrasHandler_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.Func <System.Collections.Generic.Dictionary <System.String, System.String> > a1; checkDelegate(l, 1, out a1); BuglyAgent.SetLogCallbackExtrasHandler(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 }
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); }
static int _m_SetLogCallbackExtrasHandler_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { System.Func <System.Collections.Generic.Dictionary <string, string> > _handler = translator.GetDelegate <System.Func <System.Collections.Generic.Dictionary <string, string> > >(L, 1); BuglyAgent.SetLogCallbackExtrasHandler(_handler); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }