A mobile app for thmmy.gr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.8 KiB

8 years ago
package mthmmy.utils;
import com.google.firebase.crash.FirebaseCrash;
8 years ago
public class Report
8 years ago
{
public static void v (String TAG, String message)
{
log("V", TAG, message);
8 years ago
}
public static void v (String TAG, String message, Throwable tr)
{
exception("V", TAG, message, tr);
8 years ago
}
public static void d (String TAG, String message)
{
log("D", TAG, message);
8 years ago
}
public static void d (String TAG, String message, Throwable tr)
{
exception("D", TAG, message, tr);
8 years ago
}
public static void i (String TAG, String message)
{
log("I", TAG, message);
8 years ago
}
public static void i (String TAG, String message, Throwable tr)
{
exception("I", TAG, message, tr);
8 years ago
}
public static void w (String TAG, String message)
{
log("W", TAG, message);
8 years ago
}
public static void w (String TAG, String message, Throwable tr)
{
exception("W", TAG, message, tr);
8 years ago
}
public static void e (String TAG, String message)
{
log("E", TAG, message);
8 years ago
}
public static void e (String TAG, String message, Throwable tr)
{
exception("E", TAG, message, tr);
8 years ago
}
public static void wtf (String TAG, String message)
{
log("WTF", TAG, message);
8 years ago
}
public static void wtf (String TAG, String message, Throwable tr)
{
exception("WTF", TAG, message, tr);
8 years ago
}
private static void log(String level, String TAG, String message)
{
FirebaseCrash.log(level + "/" + TAG + ": " + message);
}
private static void exception(String level, String TAG, String message, Throwable tr)
{
FirebaseCrash.log(level + "/" + TAG + ": " + message + ": " + tr.getMessage());
if(level.equals("E")) //report only serious exceptions
FirebaseCrash.report(tr);
}
8 years ago
}