ACRA 发送自定义数据 REPORTFIELD
ACRA sending a custom data REPORTFIELD
如何使用 couchdb 配置 CUSTOM_DATA 字段?
我想设置一个配置值来发送错误。在后端,我有一个带 ACLARYZER 网络应用程序的沙发数据库。
这是我在 Android 中定义此自定义数据值的 Application.class 上的代码。
@ReportsCrashes(
formUri = "https://user.cloudant.com/acra-report/_design/acra-storage/_update/report",
reportType = HttpSender.Type.JSON,
httpMethod = HttpSender.Method.POST,
formUriBasicAuthLogin = "user",
formUriBasicAuthPassword = "pass",
formKey = "", // This is required for backward compatibility but not used
customReportContent = {
ReportField.APP_VERSION_CODE,
ReportField.APP_VERSION_NAME,
ReportField.ANDROID_VERSION,
ReportField.PACKAGE_NAME,
ReportField.REPORT_ID,
ReportField.BUILD,
ReportField.STACK_TRACE,
ReportField.CUSTOM_DATA
},
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.reporte_error
)
public class my_applicaction extends Application{
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
ACRA.init(my_applicaction.this);
ACRA.getErrorReporter().putCustomData("myKey", "myValue");
ACRA.getErrorReporter().handleException(null);
}
}
现在问题是如何在 couch 数据库中添加值以获取此自定义数据字段。或者我必须在 ACRALYZER 中定义自定义数据?
谢谢
终于比想象中的简单多了
只需将此行与每个 CUSTOM_DATA
ACRA.getErrorReporter().putCustomData("NAME_VALUE1", "VALUE1");
那么你的代码是这样的。
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
ACRA.init(Application.this);
ACRA.getErrorReporter().putCustomData("NAME_VALUE1", "VALUE1");
ACRA.getErrorReporter().putCustomData("NAME_VALUE2", "VALUE2");
ACRA.getErrorReporter().putCustomData("NAME_VALUE3", "VALUE3");
}
ACLARYZER 完成剩下的工作。
如何使用 couchdb 配置 CUSTOM_DATA 字段?
我想设置一个配置值来发送错误。在后端,我有一个带 ACLARYZER 网络应用程序的沙发数据库。
这是我在 Android 中定义此自定义数据值的 Application.class 上的代码。
@ReportsCrashes(
formUri = "https://user.cloudant.com/acra-report/_design/acra-storage/_update/report",
reportType = HttpSender.Type.JSON,
httpMethod = HttpSender.Method.POST,
formUriBasicAuthLogin = "user",
formUriBasicAuthPassword = "pass",
formKey = "", // This is required for backward compatibility but not used
customReportContent = {
ReportField.APP_VERSION_CODE,
ReportField.APP_VERSION_NAME,
ReportField.ANDROID_VERSION,
ReportField.PACKAGE_NAME,
ReportField.REPORT_ID,
ReportField.BUILD,
ReportField.STACK_TRACE,
ReportField.CUSTOM_DATA
},
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.reporte_error
)
public class my_applicaction extends Application{
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
ACRA.init(my_applicaction.this);
ACRA.getErrorReporter().putCustomData("myKey", "myValue");
ACRA.getErrorReporter().handleException(null);
}
}
现在问题是如何在 couch 数据库中添加值以获取此自定义数据字段。或者我必须在 ACRALYZER 中定义自定义数据?
谢谢
终于比想象中的简单多了
只需将此行与每个 CUSTOM_DATA
ACRA.getErrorReporter().putCustomData("NAME_VALUE1", "VALUE1");
那么你的代码是这样的。
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
ACRA.init(Application.this);
ACRA.getErrorReporter().putCustomData("NAME_VALUE1", "VALUE1");
ACRA.getErrorReporter().putCustomData("NAME_VALUE2", "VALUE2");
ACRA.getErrorReporter().putCustomData("NAME_VALUE3", "VALUE3");
}
ACLARYZER 完成剩下的工作。