How do I use logging?
At times, even full stack traces
with line numbers aren't quite enough to pinpoint the bug.To give you even more insight, Crashlytics provides 4 logging mechanisms right out of the box: Logging, Custom Keys, User Information, and Caught Exceptions.
Custom Logging
Logged messages are associated with your crash data and are visible in the Crashlytics dashboard if you look at the specific crash itself.
We've built Crashlytics.log to help pinpoint issues.
The recommended way to add custom logging to your app is:
Crashlytics.log(int priority, String tag, String msg)
In addition to
writing to the next crash report, it will also write to to LogCat using android.util.Log.println(priority, tag, msg)
.
If you don't want to write to LogCat you should call
Crashlytics.log(msg)
which will only write to the Crashlytics crash report.
Example:
Crashlytics.log(Log.ERROR, "MyApp", "Higgs-Boson detected! Bailing out...");