I want to use Crashlytics.setInt(KEY, val) to see the value a variable had at the time of the crash.
I wish to avoid calling the method every time the value changes.
I have more than one thing in mind, but among them, logging of time since starting a resource-intensive task (e.g. video streaming).
I suppose this could be done with a custom UncaughtExceptionhandler, but is there a cleaner way?
[edit] if it wasn't clear, I want this to happen:
- Crash occurs
- Crashlytics.setLong(TIME_SINCE_XYZ_STARTED, System.currentTimeMillis() - startTimeOfXyz); Crashlytics.setString(XYZ_STATE, xyz.connState); Crashlytics.setInt(XYZ_QUEUE_LENGTH, xyz.queue.size())
- Crashlytics compiles crash report
The problem being that I can perform step 2 at any time, but I want it to be triggered by the crash.