Skip to main content

Adding information to events

HasTracerSystemInfo description

Tracer SDK provides the most important failure information, so you don't have to worry about it:

  • date — date and time of an event;
  • boardBuild.BOARD;
  • brandBuild.BRAND;
  • cpuABIBuild.SUPPORTED_ABIS;
  • deviceBuild.DEVICE;
  • displayBuild.DISPLAY;
  • manufacturerBuild.MANUFACTURER;
  • modelBuild.MODEL;
  • osVersionSdkIntBuild.VERSION.SDK_INT;
  • osVersionReleaseBuild.VERSION.RELEASE;
  • cpuCountRuntime.getRuntime().availableProcessors();
  • operatorName — operator name (if available).

You can add additional failure information in your app's HasTracerSystemInfo implementation (see below).

class MyApplication : Application(), HasTracerSystemInfo {
override val tracerSystemInfo: Map<String, String>
get() = mapOf {
"foo" to "bar" ,
}
}

Useful examples of such information are: userId, build flavor, or vendor — if a build is intended for preinstallation.

HasTracerSystemInfo.tracerSystemInfo is called on every CRASH and NON-FATAL event. It will also be called once on app start in case of ANR.

TracerCrashReport.log description

Logs preceding an even are also attached to that event. You can add logs using the TracerCrasgReport.log method.

// upon event occurrence
TracerCrashReport.log( "button 100500 clicked" )
// 100500 lines after that
TracerCrashReport.report(NoSuchElementException( "Nothing here, see logs" ))
// on the logs tab of this non-fatal you'll see the line: "event button 100500 clicked" |
caution

Logs are not stored is indefinitely. Currently, they are gathered in a circular 64 KB buffer.