public class

FirebaseCrash

extends Object
java.lang.Object
   ↳ com.google.firebase.crash.FirebaseCrash

Class Overview

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.

Summary

Public Methods
static FirebaseCrash getInstance(FirebaseApp firebaseApp)
FirebaseCrash instance configured with a firebaseApp.
static boolean isSingletonInitialized()
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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static FirebaseCrash getInstance (FirebaseApp firebaseApp)

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 boolean isSingletonInitialized ()

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