// Token: 0x0601564B RID: 87627 RVA: 0x0056D038 File Offset: 0x0056B238 private static void _RegisterExceptionHandler() { try { if (BuglyAgent.< > f__mg$cache0 == null) { BuglyAgent.< > f__mg$cache0 = new Application.LogCallback(BuglyAgent._OnLogCallbackHandler); } Application.RegisterLogCallback(BuglyAgent.< > f__mg$cache0); AppDomain currentDomain = AppDomain.CurrentDomain; if (BuglyAgent.< > f__mg$cache1 == null) { BuglyAgent.< > f__mg$cache1 = new UnhandledExceptionEventHandler(BuglyAgent._OnUncaughtExceptionHandler); } currentDomain.UnhandledException += BuglyAgent.< > f__mg$cache1; BuglyAgent._isInitialized = true; BuglyAgent.DebugLog(null, "Register the log callback in Unity {0}", new object[] { Application.unityVersion }); } catch { } BuglyAgent.SetUnityVersion(); }
static public int DebugLog_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.Object[] a3; checkParams(l, 3, out a3); BuglyAgent.DebugLog(a1, a2, a3); 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 }
// Token: 0x06015634 RID: 87604 RVA: 0x0056CEB8 File Offset: 0x0056B0B8 public static void ConfigDebugMode(bool enable) { BuglyAgent.EnableDebugMode(enable); BuglyAgent.DebugLog(null, "{0} the log message print to console", new object[] { (!enable) ? "Disable" : "Enable" }); }
// Token: 0x06015630 RID: 87600 RVA: 0x0056CE10 File Offset: 0x0056B010 public static void UnregisterLogCallback(BuglyAgent.LogCallbackDelegate handler) { if (handler != null) { BuglyAgent.DebugLog(null, "Remove log callback handler", new object[0]); BuglyAgent._LogCallbackEventHandler -= handler; } }
// Token: 0x0601562B RID: 87595 RVA: 0x0056CD30 File Offset: 0x0056AF30 public static void EnableExceptionHandler() { if (BuglyAgent.IsInitialized) { BuglyAgent.DebugLog(null, "BuglyAgent has already been initialized.", new object[0]); return; } BuglyAgent.DebugLog(null, "Only enable the exception handler, please make sure you has initialized the sdk in the native code in associated Android or iOS project.", new object[0]); BuglyAgent._RegisterExceptionHandler(); }
// Token: 0x06015637 RID: 87607 RVA: 0x0056CEFC File Offset: 0x0056B0FC public static void ConfigDefault(string channel, string version, string user, long delay) { BuglyAgent.DebugLog(null, "Config default channel:{0}, version:{1}, user:{2}, delay:{3}", new object[] { channel, version, user, delay }); BuglyAgent.ConfigDefaultBeforeInit(channel, version, user, delay); }
// Token: 0x0601562C RID: 87596 RVA: 0x0056CD64 File Offset: 0x0056AF64 public static void RegisterLogCallback(BuglyAgent.LogCallbackDelegate handler) { if (handler != null) { BuglyAgent.DebugLog(null, "Add log callback handler: {0}", new object[] { handler }); BuglyAgent._LogCallbackEventHandler += handler; } }
// Token: 0x0601562D RID: 87597 RVA: 0x0056CD88 File Offset: 0x0056AF88 public static void SetLogCallbackExtrasHandler(Func <Dictionary <string, string> > handler) { if (handler != null) { BuglyAgent._LogCallbackExtrasHandler = handler; BuglyAgent.DebugLog(null, "Add log callback extra data handler : {0}", new object[] { handler }); } }
void Awake() { BuglyAgent.DebugLog("Demo.Awake()", "Screen: {0} x {1}", Screen.width, Screen.height); screenWidth = Screen.width; screenHeight = Screen.height; guiRatioX = (float)(screenWidth / StandardScreenWidth * 1.0f); guiRatioY = (float)(screenHeight / StandardScreenHeight * 1.0f); scaleGUIs = new Vector3(guiRatioX, guiRatioY, 1.0f); }
// Token: 0x06015632 RID: 87602 RVA: 0x0056CE58 File Offset: 0x0056B058 public static void SetScene(int sceneId) { if (!BuglyAgent.IsInitialized) { return; } BuglyAgent.DebugLog(null, "Set scene: {0}", new object[] { sceneId }); BuglyAgent.SetCurrentScene(sceneId); }
// Token: 0x06015631 RID: 87601 RVA: 0x0056CE30 File Offset: 0x0056B030 public static void SetUserId(string userId) { if (!BuglyAgent.IsInitialized) { return; } BuglyAgent.DebugLog(null, "Set user id: {0}", new object[] { userId }); BuglyAgent.SetUserInfo(userId); }
// Token: 0x0601562E RID: 87598 RVA: 0x0056CDAC File Offset: 0x0056AFAC public static void ReportException(Exception e, string message) { if (!BuglyAgent.IsInitialized) { return; } BuglyAgent.DebugLog(null, "Report exception: {0}\n------------\n{1}\n------------", new object[] { message, e }); BuglyAgent._HandleException(e, message, false); }
// Token: 0x06015633 RID: 87603 RVA: 0x0056CE88 File Offset: 0x0056B088 public static void AddSceneData(string key, string value) { if (!BuglyAgent.IsInitialized) { return; } BuglyAgent.DebugLog(null, "Add scene data: [{0}, {1}]", new object[] { key, value }); BuglyAgent.AddKeyAndValueInScene(key, value); }
private void Awake() { BuglyAgent.DebugLog("Demo.Awake()", "Screen: {0} x {1}", new object[] { Screen.width, Screen.height }); this.screenWidth = (float)Screen.width; this.screenHeight = (float)Screen.height; this.guiRatioX = this.screenWidth / BuglyTest.StandardScreenWidth * 1f; this.guiRatioY = this.screenHeight / BuglyTest.StandardScreenHeight * 1f; this.scaleGUIs = new Vector3(this.guiRatioX, this.guiRatioY, 1f); }
// Token: 0x0601562F RID: 87599 RVA: 0x0056CDDC File Offset: 0x0056AFDC public static void ReportException(string name, string message, string stackTrace) { if (!BuglyAgent.IsInitialized) { return; } BuglyAgent.DebugLog(null, "Report exception: {0} {1} \n{2}", new object[] { name, message, stackTrace }); BuglyAgent._HandleException(LogSeverity.LogException, name, message, stackTrace, false); }
private static void _UnregisterExceptionHandler() { try { Application.RegisterLogCallback(null); AppDomain.get_CurrentDomain().remove_UnhandledException(new UnhandledExceptionEventHandler(BuglyAgent._OnUncaughtExceptionHandler)); BuglyAgent.DebugLog(null, "Unregister the log callback in unity {0}", new object[] { Application.unityVersion }); } catch { } }
private static void _UnregisterExceptionHandler() { try { Application.logMessageReceived -= new Application.LogCallback(BuglyAgent._OnLogCallbackHandler); AppDomain.CurrentDomain.UnhandledException -= new UnhandledExceptionEventHandler(BuglyAgent._OnUncaughtExceptionHandler); BuglyAgent.DebugLog(null, "Unregister the log callback in unity {0}", new object[] { Application.unityVersion }); } catch { } }
private static void _RegisterExceptionHandler() { try { Application.logMessageReceived += new Application.LogCallback(BuglyAgent._OnLogCallbackHandler); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(BuglyAgent._OnUncaughtExceptionHandler); BuglyAgent._isInitialized = true; BuglyAgent.DebugLog(null, "Register the log callback in Unity {0}", new object[] { Application.unityVersion }); } catch { } BuglyAgent.SetUnityVersion(); }
private static void LogRecord(LogSeverity level, string message) { if (level < LogSeverity.LogWarning) { BuglyAgent.DebugLog(level.ToString(), message, new object[0]); } BuglyAgent.ConfigCrashReporterPackage(); try { BuglyAgent.GameAgent.CallStatic("printLog", new object[] { string.Format("<{0}> - {1}", level.ToString(), message) }); } catch { } }
private static void LogRecord(LogSeverity level, string message) { if (level < LogSeverity.LogWarning) { BuglyAgent.DebugLog(level.ToString(), message, new object[0]); return; } try { BuglyAgent.UnityAgent.Call("printLog", new object[] { string.Format("<{0}> - {1}", level.ToString(), message) }); } catch { } }
// Token: 0x0601562A RID: 87594 RVA: 0x0056CCD8 File Offset: 0x0056AED8 public static void InitWithAppId(string appId) { if (BuglyAgent.IsInitialized) { BuglyAgent.DebugLog(null, "BuglyAgent has already been initialized.", new object[0]); return; } if (string.IsNullOrEmpty(appId)) { return; } BuglyAgent.InitBuglyAgent(appId); BuglyAgent.DebugLog(null, "Initialized with app id: {0}", new object[] { appId }); BuglyAgent._RegisterExceptionHandler(); }
// Token: 0x0601564C RID: 87628 RVA: 0x0056D0D0 File Offset: 0x0056B2D0 private static void _UnregisterExceptionHandler() { try { Application.RegisterLogCallback(null); AppDomain currentDomain = AppDomain.CurrentDomain; if (BuglyAgent.< > f__mg$cache2 == null) { BuglyAgent.< > f__mg$cache2 = new UnhandledExceptionEventHandler(BuglyAgent._OnUncaughtExceptionHandler); } currentDomain.UnhandledException -= BuglyAgent.< > f__mg$cache2; BuglyAgent.DebugLog(null, "Unregister the log callback in unity {0}", new object[] { Application.unityVersion }); } catch { } }
static int _m_DebugLog_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { string _tag = LuaAPI.lua_tostring(L, 1); string _format = LuaAPI.lua_tostring(L, 2); object[] _args = translator.GetParams <object>(L, 3); BuglyAgent.DebugLog(_tag, _format, _args); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
// Token: 0x06015651 RID: 87633 RVA: 0x0056D6BC File Offset: 0x0056B8BC private static void _HandleException(LogSeverity logLevel, string name, string message, string stackTrace, bool uncaught) { if (!BuglyAgent.IsInitialized) { BuglyAgent.DebugLog(null, "It has not been initialized.", new object[0]); return; } if (logLevel == LogSeverity.Log) { return; } if (uncaught && logLevel < BuglyAgent._autoReportLogLevel) { BuglyAgent.DebugLog(null, "Not report exception for level {0}", new object[] { logLevel.ToString() }); return; } string text = null; string text2 = null; if (!string.IsNullOrEmpty(message)) { try { if (logLevel == LogSeverity.LogException && message.Contains("Exception")) { Match match = new Regex("^(?<errorType>\\S+):\\s*(?<errorMessage>.*)", RegexOptions.Singleline).Match(message); if (match.Success) { text = match.Groups["errorType"].Value.Trim(); text2 = match.Groups["errorMessage"].Value.Trim(); } } else if (logLevel == LogSeverity.LogError && message.StartsWith("Unhandled Exception:")) { Match match2 = new Regex("^Unhandled\\s+Exception:\\s*(?<exceptionName>\\S+):\\s*(?<exceptionDetail>.*)", RegexOptions.Singleline).Match(message); if (match2.Success) { string text3 = match2.Groups["exceptionName"].Value.Trim(); string text4 = match2.Groups["exceptionDetail"].Value.Trim(); int num = text3.LastIndexOf("."); if (num > 0 && num != text3.Length) { text = text3.Substring(num + 1); } else { text = text3; } int num2 = text4.IndexOf(" at "); if (num2 > 0) { text2 = text4.Substring(0, num2); string text5 = text4.Substring(num2 + 3).Replace(" at ", "\n").Replace("in <filename unknown>:0", string.Empty).Replace("[0x00000]", string.Empty); stackTrace = string.Format("{0}\n{1}", stackTrace, text5.Trim()); } else { text2 = text4; } if (text.Equals("LuaScriptException") && text4.Contains(".lua") && text4.Contains("stack traceback:")) { num2 = text4.IndexOf("stack traceback:"); if (num2 > 0) { text2 = text4.Substring(0, num2); string text6 = text4.Substring(num2 + 16).Replace(" [", " \n["); stackTrace = string.Format("{0}\n{1}", stackTrace, text6.Trim()); } } } } } catch { } if (string.IsNullOrEmpty(text2)) { text2 = message; } } if (string.IsNullOrEmpty(name)) { if (string.IsNullOrEmpty(text)) { text = string.Format("Unity{0}", logLevel.ToString()); } } else { text = name; } BuglyAgent._reportException(uncaught, text, text2, stackTrace); }