Added caller to extras

pull/201/head
M66B 3 years ago
parent 147290953d
commit 92aeb6d6ae

@ -207,10 +207,13 @@ public class Log {
public static int w(Throwable ex) {
if (BuildConfig.BETA_RELEASE)
try {
final StackTraceElement[] ste = new Throwable().getStackTrace();
Bugsnag.notify(ex, new OnErrorCallback() {
@Override
public boolean onError(@NonNull Event event) {
event.setSeverity(Severity.INFO);
if (ste.length > 1)
event.addMetadata("extra", "caller", ste[1].toString());
return true;
}
});
@ -223,10 +226,13 @@ public class Log {
public static int e(Throwable ex) {
if (BuildConfig.BETA_RELEASE)
try {
final StackTraceElement[] ste = new Throwable().getStackTrace();
Bugsnag.notify(ex, new OnErrorCallback() {
@Override
public boolean onError(@NonNull Event event) {
event.setSeverity(Severity.WARNING);
if (ste.length > 1)
event.addMetadata("extra", "caller", ste[1].toString());
return true;
}
});

Loading…
Cancel
Save