Summary: Methods | Inherited Methods | [Expand All]
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
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## 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

##### See Also

- `logcat(int, String, String)`

#### 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

- `log(String)`

#### 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