根据织物文档 Fabric doc为了减少用户流量,仅在应用启动时发送捕获的异常 -
Crashlytics processes exceptions on a dedicated background thread, so the performance impact to your app is minimal. To reduce your users’ network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches.
try {
myMethodThatThrows();
} catch (Exception e) {
Crashlytics.logException(e);
// handle your exception here!
}
但是对于这个特定的应用程序,该应用程序将始终处于开启状态,并且不会重新启动。所以问题是——
如何强制在一段时间或某个事件后发送日志?
最佳答案
来自 Fabric 的 Mike。
目前,我们的 SDK 不提供从正在运行的 Android 应用程序手动刷新或推送日志的方法。重新启动应用程序时会发送记录的异常。
关于Android Fabric - 以自定义间隔发送捕获的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38347211/