mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-28 16:55:56 +00:00
Limit error reports in stable builds
This commit is contained in:
parent
6dbf097e47
commit
cef1389244
1 changed files with 11 additions and 7 deletions
|
@ -63,7 +63,7 @@ import javax.mail.Address;
|
||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
|
|
||||||
public class Log {
|
public class Log {
|
||||||
static final String TAG = "fairemail";
|
private static final String TAG = "fairemail";
|
||||||
|
|
||||||
public static int i(String msg) {
|
public static int i(String msg) {
|
||||||
if (BuildConfig.BETA_RELEASE)
|
if (BuildConfig.BETA_RELEASE)
|
||||||
|
@ -85,31 +85,35 @@ public class Log {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int w(Throwable ex) {
|
public static int w(Throwable ex) {
|
||||||
|
if (BuildConfig.BETA_RELEASE)
|
||||||
Bugsnag.notify(ex, Severity.INFO);
|
Bugsnag.notify(ex, Severity.INFO);
|
||||||
return android.util.Log.w(TAG, ex + "\n" + android.util.Log.getStackTraceString(ex));
|
return android.util.Log.w(TAG, ex + "\n" + android.util.Log.getStackTraceString(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int e(Throwable ex) {
|
public static int e(Throwable ex) {
|
||||||
|
if (BuildConfig.BETA_RELEASE)
|
||||||
Bugsnag.notify(ex, Severity.WARNING);
|
Bugsnag.notify(ex, Severity.WARNING);
|
||||||
return android.util.Log.e(TAG, ex + "\n" + android.util.Log.getStackTraceString(ex));
|
return android.util.Log.e(TAG, ex + "\n" + android.util.Log.getStackTraceString(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int w(String prefix, Throwable ex) {
|
public static int w(String prefix, Throwable ex) {
|
||||||
|
if (BuildConfig.BETA_RELEASE)
|
||||||
Bugsnag.notify(ex, Severity.INFO);
|
Bugsnag.notify(ex, Severity.INFO);
|
||||||
return android.util.Log.w(TAG, prefix + " " + ex + "\n" + android.util.Log.getStackTraceString(ex));
|
return android.util.Log.w(TAG, prefix + " " + ex + "\n" + android.util.Log.getStackTraceString(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int e(String prefix, Throwable ex) {
|
public static int e(String prefix, Throwable ex) {
|
||||||
|
if (BuildConfig.BETA_RELEASE)
|
||||||
Bugsnag.notify(ex, Severity.WARNING);
|
Bugsnag.notify(ex, Severity.WARNING);
|
||||||
return android.util.Log.e(TAG, prefix + " " + ex + "\n" + android.util.Log.getStackTraceString(ex));
|
return android.util.Log.e(TAG, prefix + " " + ex + "\n" + android.util.Log.getStackTraceString(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void logExtras(Intent intent) {
|
static void logExtras(Intent intent) {
|
||||||
if (intent != null)
|
if (intent != null)
|
||||||
logBundle(intent.getExtras());
|
logBundle(intent.getExtras());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void logBundle(Bundle data) {
|
static void logBundle(Bundle data) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
Set<String> keys = data.keySet();
|
Set<String> keys = data.keySet();
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
|
Loading…
Reference in a new issue