File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
app/src/main/java/com/termux/window Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ public class TermuxFloatActivity extends Activity {
1111 @ Override
1212 protected void onResume () {
1313 super .onResume ();
14+
15+ // Set log level for the app
16+ TermuxFloatApplication .setLogConfig (this , false );
17+
1418 startService (new Intent (this , TermuxFloatService .class ));
1519 finish ();
1620 }
Original file line number Diff line number Diff line change 22
33import android .app .Application ;
44import android .content .Context ;
5+ import android .util .Log ;
56
67import com .termux .shared .logger .Logger ;
78import com .termux .shared .termux .TermuxConstants ;
1011
1112public class TermuxFloatApplication extends Application {
1213
14+ public static final String LOG_TAG = "TermuxFloatApplication" ;
15+
1316 public void onCreate () {
1417 super .onCreate ();
1518
19+ Log .i (LOG_TAG , "AppInit" );
20+
21+ Context context = getApplicationContext ();
22+
1623 // Set crash handler for the app
17- TermuxCrashUtils .setCrashHandler (this );
24+ TermuxCrashUtils .setCrashHandler (context );
1825
1926 // Set log config for the app
20- setLogConfig (getApplicationContext (), true );
21-
22- Logger .logDebug ("Starting Application" );
27+ setLogConfig (context , true );
2328 }
2429
2530 public static void setLogConfig (Context context , boolean commitToFile ) {
26- // Logger.setDefaultLogTag(TermuxConstants.TERMUX_FLOAT_APP_NAME);
31+ Logger .setDefaultLogTag (TermuxConstants .TERMUX_FLOAT_APP_NAME . replaceAll ( "[: ]" , "" ) );
2732
2833 // Load the log level from shared preferences and set it to the {@link Logger.CURRENT_LOG_LEVEL}
2934 TermuxFloatAppSharedPreferences preferences = TermuxFloatAppSharedPreferences .build (context );
You can’t perform that action at this time.
0 commit comments