Testing and Debugging
1. Print File Output
JL_Log.setTagPrefix("health"); // Set log identifier
// Log configuration
// context --- Context, recommended to use getApplicationContext()
// islog --- Whether to output print, recommended to enable during development, disable when releasing
// isSaveFile --- Whether to save log files, recommended to enable during development, disable when releasing
JL_Log.configureLog(context, BuildConfig.DEBUG, BuildConfig.DEBUG);
Note
1. It’s recommended to set up print output in Application
2. Debug version enables printing by default, release version disables printing by default
3. Customers can configure whether to enable debug debugging in the demo project
When using multiple Jieli libraries simultaneously, you can set them up as follows:
// Whether to enable printing for Jieli connection library
com.jieli.bluetooth_connect.util.JL_Log.setLog(BuildConfig.DEBUG);
if(BuildConfig.DEBUG ){// If enabled, output the print logs of Jieli connection library to Jieli health's output file
com.jieli.bluetooth_connect.util.JL_Log.setLogOutput(new com.jieli.bluetooth_connect.util.JL_Log.ILogOutput() {
@Override
public void output(String logcat) {
// Callback Jieli connection library print information here
JL_Log.addLogOutput(logcat); // Add to Jieli health library's output file
}
});
}
2. Print Files
Print File Format
Format: [tag_prefix]_log_[timestamp].txt
tag_prefix : Tag prefix – For example: health
timestamp: Timestamp
For example: health_log_20220113093020.432.txt ==> Health SDK print file, Creation time: 2022/01/13 09:30:20
File Storage Path
Location: Phone root directory/Android/data/[package_name]/files/logcat/
Package name: Application package name, for example: com.jieli.healthaide
Example: Phone root directory/Android/data/com.jieli.healthaide/files/logcat/
3. Exception Handling Steps
Important
Prerequisite: After encountering an exception, exit the APP
1. Briefly describe the problem phenomenon (required)
2. Provide the log file closest to the timestamp (required)
3. Provide screenshots or videos of the phenomenon