Crash report
Unity3D
Outline
Access Guide
View the reported data
Report the extra business log
Report the extra binary data
Report output log
Close Bugly reporting dynamically
FAQ
Android
Outline
Access Guide
View the reported data
Report the extra business log
Report the extra binary data
Report output log
Close Bugly reporting dynamically
FAQ
IOS
Outline
Access Guide
View the reported data
Report the extra business log
Report the extra binary data
Report output log
Close Bugly reporting dynamically
FAQ
Others
Data Structure
System Tools
Crash report / Unity3D / Outline

Outline

MSDK integrates Bugly's data reporting function. When the client crashes, it can upload the client information to the server for the developer to view. It can help developers find the online fatal bugs of their apps.

The following picture shows that after the online app crashes, the developer can view the client information through the Bugly platform (Note: Bugly does not report screenshots when an app crashes):


a) Report the stack information of the crashed process, as shown in the following figures: "Malfunctioned thread", "All threads", "System log".


b) Report the basic information of the current mobile phone: device name(vendor, model), system version, disk's available ratio, SD card's available ratio, memory's available ratio and so on.


c) Report the user's openid, as shown in the following picture "User name".

Query crash client information


d) User-defined reporting information, as shown in the following figure "More information".

You can define the string reported when the app crashes, as shown below

View extra data

You can also report binary data when app crashes. With the binary data, you can now find specific crash events at rdm platform -> Exception Reporting Module and download binary data files.

Report and add extra binary data

You can upload a small number of user-defined logs about app crash to the Bulgy platform and view it in Extra Data -> User-defined Log

Bugly log reporting

Access Guide

1 Preconditions


1) You have completed initialization according to the initialization module's description initialization


Please remove the check at the "CLOSD_BUGLY_REPORT" option in MSDK->Config Settings.


3) Obfuscate jar packages according to the agreement

If you do not need to obfuscate jar packages, please ignore this part. If you need to obfuscate jar packages, please do not obfuscate msdk*.jarfiles, or when you obfuscate msdk*.jar files, please add the following <br>"keep"information into App's obfuscation configuration:
-keep class * extends android.app.Activity{*;}
-keep class * extends android.app.Service{*;}
#Bugly interface
-keep public class com.tencent.bugly.crashreport.crash.jni.NativeCrashHandler{public *; native <methods>;}
-keep public interface com.tencent.bugly.crashreport.crash.jni.NativeExceptionHandler{*;}


4) Configure App restoration symbol table  Please go to the Bulgy platform to set the restoration symbol table at http://bugly.qq.com/. Refer to symbol table configuration in the Official Website of bugly to complete the configuration.

After completing the above 4 steps, you can view the stack information about the crash of online app.

2 Use crash reporting function

When App crashes, the crash reporting function can report string or binary information to the server for you to analyze it. For details, please see Add the extra business log into the report, Add the extra binary data into the report and Report output log.

View the reported data

Please use the collaborator's account to login the website bugly.qq.com and select the app you want to view, as shown in the figure below, and then view the data reported by bugly. If you do not know the collaborator account, please contact"Flying Eagle Assistant"or"Link to MSDK".

View Bulgy data sample images

Add the extra business log into the report

1 Summary

When the program crashes, it is sometimes needed to add some additional user-defined data

2 Registration callback

1)Function description

When the program crashes, it is sometimes needed to add some additional user-defined data, which will be reported to the Bugly platform along with the crash log together, so as to better locate the cause of the crash. As shown in the Outline's 3.1 section "Upload an additional string", the reported data can be found in Bugly platform's"user-defined log"->"extra data".

2)Interface declaration
public delegate String CrashReportMessageDelegate();
3)Parameter description

None

4)Return value
Return value type Parameter type Explanation
None string report user-defined string in case of crash
5)Demo code

You need to register the extra data reporting event CrashReportMessageEvent at the time of initialization and output the reporting log.

MsdkEvent.Instance.CrashReportMessageEvent += () => {
    //TODO Report user-defined string
    return "Report extra message when crash happened. MSDK version : "
    + WGPlatform.Version;
};
6)Special description

The callback may fail when native reporting is made.

7)Term interpretation

None

3 Interface calling

None

Add the extra binary data into the report

1 Summary

When the program crashes, it is sometimes needed to add some additional binary data

2 Registration callback

1)Function description

When the program crashes, it is sometimes needed to add some additional binary data, which will be reported to the Bugly platform along with the crash log together, so as to better locate the cause of the crash. In the end, check the “Error” info at the bugly platform. In terms of binary data, find the specific crash event in “Track Data >Attachment Info”, and download the binary data document.

2)Interface declaration
public delegate byte[] CrashReportDataDelegate();
3)Parameter description

None

4)Return value
Return value name Parameter type Description
None byte[] Report user-defined binary array in case of crash
5)Demo code

You need to register the extra data reporting event CrashReportDataEvent at the time of initialization and output the reporting log.

MsdkEvent.Instance.CrashReportDataEvent += () => {
 //TODO Report user-defined binary information
    string extraDataStr="Report extra data when crash happened. MSDK version : " + WGPlatform.Version;
    byte[] extraData=System.Text.Encoding.Default.GetBytes(extraDataStr);
    return extraData;
};
6)Special description

The callback may fail when native reporting is made.

7)Term interpretation

None

3 Interface calling

None

report Lua/C#/JS script error

1 summary description

When the Lua/C#/JS script of the game is exceptional, the exception messages can be reported to bugly.

2 registration callback

1)function description

Report script exception messages to bugly, perform "error analysis" on bugly -> view the reported information under tab "Lua script error /C# script error/JS script error"

2)interface declaration
void WGReportException(eExceptionType exception_type,
                            string exception_name,
                            string exception_msg,
                            string exception_stack,
                            Dictionary<string, string> ext_info);
3)parameter description
name type description
exception_type eExceptionType enumeration type exception type
exception_name String exception name
exception_msg String exception messages
exception_stack String exception stack
ext_info Dictionary event content, a Dictionary in form of key-value; the maximum length of the key is 64. The maximum length of the value is 1024. The maximum number of keys is 50. For the naming rules of the key, "B1" and "B2" are recommended so as to reduce traffic consumption
4)Return value and callback description

None

5)Demo code
Dictionary<string, string> extInfo=new Dictionary<string, string>();
extInfo.Add("key1", "values1");
extInfo.Add("key2", "values2");
extInfo.Add("key3", "values3");
            WGPlatform.Instance.WGReportException(eExceptionType.eException_CSharp, 
                                      “MSDK_exception_name",     
                                      “MSDK_exception_msg”,
                                      “MSDK_exception_stack_test",
                                      extInfo);
6)Special description

None

7)Term interpretation

None

Report output log

1 Summary

Report output log

2 Registration callback

None

3 Interface calling

1)Function description

In some native crash scenarios, event callback functions registered for Bugly, such as OnCrashReportDataEvent and CrashReportDataEvent, may not be performed. It is recommended that you use a user-defined log interface: such an interface can be used to record the debug log that some developers are interested in and can more comprehensively reflect the context before and after App exceptions. Its use mode is consistent with that of android.util.Log. The user passes TAG and log content to the interface. The log will be output in Logcat and reported in the event of an exception. The reported log has a size of up to 30K.

On the bugly webpage, check the custom log reported in "Error Analysis" -> “Custom Error”.

2)Interface declaration
void WGBuglyLog(eBuglyLogLevel level, string log);
3)Parameter description
Parameter name Parameter type Description
level enum For details, seeeBuglyLogLevelsection in the struct description
log String Content to be uploaded (printed)
4)Return value and callback description

None

5)Demo code
WGPlatform.Instance.WGBuglyLog(eBuglyLogLevel.eBuglyLogLevel_E, "bugly message test");
6)Special description

The user passes TAG and log content to the interface. The log will be output in Logcat and reported in the event of an exception. The reported log has a size of up to 30K.

7)Term interpretation

None

Close Bugly reporting dynamically

1 General description

Close Bugly reporting dynamically. When this interface is called, crash reporting will be closed but other Bugly functions will not be affected; crashes triggered by the restart of the app will be reported normally.

2 Interface call

1) Function description

In some scenarios, apps do not need to report a crash, such as: some apps do not want to report to Bugly crashes triggered during the killing of processes; at this time, they can call this interface to close crash reporting, but other Bugly functions will not be affected; crashes triggered by the restart of the apps will be reported normally.

2) Interface declaration
void WGCloseCrashReport();
3) Parameter description

None

4) Demo code
WGPlatform::GetInstance()->WGCloseCrashReport();
6) Special instructions

After this interface is called to close crash reporting, other Bugly functions will not be affected; crashes triggered by the restart of the app will be reported normally.

7) Term explanation

None