缩窄 Sentry ANR 的上报条件避免日志轰炸

This commit is contained in:
juntao
2020-12-21 10:15:20 +08:00
parent 0d9a4baf32
commit e7c4886219
2 changed files with 12 additions and 6 deletions

View File

@ -42,6 +42,15 @@ public class DataUtils {
}
SentryAndroid.init(context, options -> {
// Sentry 疯狂报 ANR (很大一部分还是莫名奇妙的 ANR)严重影响到其它闪退日志的收集
// 这里将它局限到只有官网渠道的包才统计 ANR
if ("GH_206".equals(channel)) {
options.setAnrEnabled(true);
options.setAnrTimeoutIntervalMillis(6000);
} else {
options.setAnrEnabled(false);
}
options.setDebug(BuildConfig.DEBUG);
options.setEnableSessionTracking(true);
options.setEnvironment(BuildConfig.FLAVOR);