【问题标题】:How to use BugSense correctly with custom data?如何正确使用 BugSense 与自定义数据?
【发布时间】:2014-02-25 11:13:05
【问题描述】:

我尝试在我的 Android 应用程序中实现 BugSense,但我无法看到我提交的自定义数据。我真的找不到问题出在哪里,因为我收到错误报告但没有自定义数据。我实现了 com.bugsense.trace.ExceptionCallback 以在“lastBreath”方法中接收所有未处理的异常。

这是我的示例代码:

@Override
public void lastBreath(Exception arg0) {
    Log.w(TAG, "executing lastBreath");
    // adding current details to crash data
    HashMap<String, String> errorDetails = new HashMap<String, String>();
    errorDetails.put("testKey", "testValue");
    errorDetails.put("testKey2", "testValue2");
    BugSenseHandler.sendExceptionMap(errorDetails, arg0);
    Log.w(TAG, "lastBreath executed");
}

这正在生成错误报告,但我不知道在哪里可以找到“testKey”和“testKey2”的自定义值。我用的是官网的示例代码,问题出在哪里?感谢您的帮助。

【问题讨论】:

    标签: android bugsense


    【解决方案1】:

    我收集数据的方式与您稍有不同。这是我的做法:

    //Call the initAndStartSession right before the setContentView of your activity (onCreate method)
    BugSenseHandler.initAndStartSession(UserLogin.this, APIKEY);
    //Add the values that you need to monitor
    BugSenseHandler.addCrashExtraData("testKey", testKey);
    BugSenseHandler.addCrashExtraData("testKey2", testKey2);
    

    一旦发生错误,请转到您的 BugSense 错误页面。 (链接应该类似于:https://www.bugsense.com/dashboard/project/YOUR_PROJECT_ID/errors/)并点击异常链接(如下图所示)。

    现在,一旦进入错误页面,点击“错误实例”

    现在,如果您单击扳手图标,您将看到可以显示的“testKey”和“testKey2”。

    希望它有效!

    【讨论】:

      猜你喜欢
      • 2022-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-28
      • 1970-01-01
      • 1970-01-01
      • 2011-07-09
      • 1970-01-01
      相关资源
      最近更新 更多