Move Termux app specific logic out of CrashHandler

Create the TermuxCrashUtils class that provides the default path and app for termux instead of hardcoding it in CrashHandler. TermuxCrashUtils can be used by termux plugins as well for their own usage or they can implement the CrashHandler.CrashHandlerClient if they want to log to different files or want custom logic.
This commit is contained in:
agnostic-apollo
2021-07-01 04:21:02 +05:00
parent 93a7525d9b
commit 23a900c433
3 changed files with 72 additions and 16 deletions

View File

@@ -2,7 +2,7 @@ package com.termux.app;
import android.app.Application;
import com.termux.shared.crash.CrashHandler;
import com.termux.shared.crash.TermuxCrashUtils;
import com.termux.shared.settings.preferences.TermuxAppSharedPreferences;
import com.termux.shared.logger.Logger;
@@ -12,7 +12,7 @@ public class TermuxApplication extends Application {
super.onCreate();
// Set crash handler for the app
CrashHandler.setCrashHandler(this);
TermuxCrashUtils.setCrashHandler(this);
// Set log level for the app
setLogLevel();