From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/Bugly/BuglyInit.cs | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Client/Assets/Scripts/Bugly/BuglyInit.cs (limited to 'Client/Assets/Scripts/Bugly/BuglyInit.cs') diff --git a/Client/Assets/Scripts/Bugly/BuglyInit.cs b/Client/Assets/Scripts/Bugly/BuglyInit.cs new file mode 100644 index 00000000..030afdf5 --- /dev/null +++ b/Client/Assets/Scripts/Bugly/BuglyInit.cs @@ -0,0 +1,48 @@ + + +// ---------------------------------------- +// +// BuglyInit.cs +// +// Author: +// Yeelik, +// +// Copyright (c) 2015 Bugly, Tencent. All rights reserved. +// +// ---------------------------------------- +// +using UnityEngine; +using System.Collections; + +public class BuglyInit : MonoBehaviour +{ + /// + /// Your Bugly App ID. Every app has a special identifier that allows Bugly to associate error monitoring data with your app. + /// Your App ID can be found on the "Setting" page of the app you are trying to monitor. + /// + /// A real App ID looks like this: 90000xxxx + private const string BuglyAppID = "YOUR APP ID GOES HERE"; + + 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); + } +} + -- cgit v1.1-26-g67d0