代码拉取完成,页面将自动刷新
登录sentry后台查看记录的异常信息数据
在moudle级别下的build.gradle文件中添加依赖
// 添加maven仓库
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}
// 添加依赖库
dependencies {
implementation 'com.gitee.chinasoft_ohos:sentry-java:1.0.1'
}
在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
1.在sentry后台(https://sentry.io
)申请创建java应用,获取应用dsn标识
2.在项目中AbilityPackage设置sentry配置。
SentryOhos.init(this,
options -> {
options.setDebug(true);
options.setEnableNdk(true);
options.setDsn("https://xxxxx@o808855.ingest.sentry.io/5804313");
});
3.使用sentry发送普通message到后台
Sentry.captureMessage("Some message.");
4.使用sentry发送自定义异常信息。
SentryId sentryId = Sentry.captureException(new Exception("I have feedback"));
UserFeedback userFeedback = new UserFeedback(sentryId);
userFeedback.setComments("It broke on Ohos. I don't know why, but this happens.");
userFeedback.setEmail("john@me.com");
userFeedback.setName("John Me");
Sentry.captureUserFeedback(userFeedback);
5.使用sentry发送自定义user信息。
Sentry.setTag("user_set", "null");
User user = new User();
user.setEmail("xxxyyy@123.com");
user.setId("195.786.258.369");
Sentry.setUser(user);
CodeCheck代码测试无异常
CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本无差异
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。