FirebaseCrash

public class FirebaseCrash extends Object

Firebase Crash reporting API. The API is automatically initialized by FirebaseApp.

To report caught exceptions, use report(Throwable).

To attach log messages to a crash report, use log(String) or logcat(int, String, String) at points during execution that will best help you know what happened prior to the crash.

Public Method Summary

static FirebaseCrash
getInstance(FirebaseApp firebaseApp)
This method was deprecated. No replacement.
static void
log(String message)
Logs a message that will appear in a subsequent crash report.
static void
logcat(int level, String tag, String message)
Logs a message that will appear in a subsequent crash report as well as in logcat.
static void
report(Throwable throwable)
Generates a crash report for the given caught exception.

Inherited Method Summary

Public Methods

public static FirebaseCrash getInstance (FirebaseApp firebaseApp)

This method was deprecated.
No replacement.

FirebaseCrash instance configured with a firebaseApp. Each instance registers an uncaught exception handler, so it should only be called once!

Parameters
firebaseApp Used for configuration

public static void log (String message)

Logs a message that will appear in a subsequent crash report.

Parameters
message the message to log

public static void logcat (int level, String tag, String message)

Logs a message that will appear in a subsequent crash report as well as in logcat. The logcat message will have the given log level and tag as would be used by println(int, String, String).

Parameters
level the log level, one of the log level constants from Log.
tag the tag to use when logging to logcat
message the message to log
See Also

public static void report (Throwable throwable)

Generates a crash report for the given caught exception. This method should be used for unexpected exceptions where recovery is not possible. For example:

try {
     // Some code here...
 } catch (Exception e) {
     // Don't know what to do with this...
     FirebaseCrash.log("Caught an unexpected exception while doing some work");
     FirebaseCrash.report(e);
 }
 

Parameters
throwable the caught exception to report

Send feedback about...

Need help? Visit our support page.