mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 09:03:56 +02:00
Log/persist refactoring
This commit is contained in:
@@ -138,6 +138,8 @@ import javax.net.ssl.SSLPeerUnverifiedException;
|
||||
import io.requery.android.database.CursorWindowAllocationException;
|
||||
|
||||
public class Log {
|
||||
private static Context ctx;
|
||||
|
||||
private static int level = android.util.Log.INFO;
|
||||
private static final int MAX_CRASH_REPORTS = 5;
|
||||
private static final String TAG = "fairemail";
|
||||
@@ -286,6 +288,13 @@ public class Log {
|
||||
return android.util.Log.e(TAG, prefix + " " + ex + "\n" + android.util.Log.getStackTraceString(ex));
|
||||
}
|
||||
|
||||
public static void persist(String message) {
|
||||
if (ctx == null)
|
||||
Log.e(message);
|
||||
else
|
||||
EntityLog.log(ctx, message);
|
||||
}
|
||||
|
||||
static void setCrashReporting(boolean enabled) {
|
||||
try {
|
||||
if (enabled)
|
||||
@@ -319,6 +328,7 @@ public class Log {
|
||||
}
|
||||
|
||||
static void setup(Context context) {
|
||||
ctx = context;
|
||||
setLevel(context);
|
||||
setupBugsnag(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user