2018-07-26 10:10:46 -04:00
|
|
|
package org.thoughtcrime.securesms.logging;
|
|
|
|
|
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
|
|
|
|
public class UncaughtExceptionLogger implements Thread.UncaughtExceptionHandler {
|
|
|
|
|
|
|
|
private static final String TAG = UncaughtExceptionLogger.class.getSimpleName();
|
|
|
|
|
|
|
|
private final Thread.UncaughtExceptionHandler originalHandler;
|
|
|
|
|
2019-04-10 12:53:55 -04:00
|
|
|
public UncaughtExceptionLogger(@NonNull Thread.UncaughtExceptionHandler originalHandler) {
|
|
|
|
this.originalHandler = originalHandler;
|
2018-07-26 10:10:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void uncaughtException(Thread t, Throwable e) {
|
|
|
|
Log.e(TAG, "", e);
|
2019-04-10 12:53:55 -04:00
|
|
|
Log.blockUntilAllWritesFinished();
|
2018-07-26 10:10:46 -04:00
|
|
|
originalHandler.uncaughtException(t, e);
|
|
|
|
}
|
|
|
|
}
|