diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java b/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java index 5d375d6..6dcc259 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java @@ -46,6 +46,8 @@ import btools.router.RoutingHelper; public class BInstallerActivity extends AppCompatActivity { + private static final String TAG = "BInstallerActivity"; + private static final int DIALOG_CONFIRM_DELETE_ID = 1; private static final int DIALOG_CONFIRM_NEXTSTEPS_ID = 2; private static final int DIALOG_CONFIRM_GETDIFFS_ID = 3; @@ -216,7 +218,7 @@ public class BInstallerActivity extends AppCompatActivity { Object data; Toast.makeText(this, R.string.msg_too_much_data, Toast.LENGTH_LONG).show(); - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); return; } @@ -242,10 +244,9 @@ public class BInstallerActivity extends AppCompatActivity { //WorkManager.getInstance(getApplicationContext()).cancelWorkById(downloadWorkRequest.getId()); } } catch (ExecutionException e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); } catch (InterruptedException e) { - Log.d("worker", "canceled " + e.getMessage()); - //e.printStackTrace(); + Log.d(TAG, "canceled " + e.getMessage()); } workManager @@ -516,10 +517,10 @@ public class BInstallerActivity extends AppCompatActivity { } return running; } catch (ExecutionException e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); return false; } catch (InterruptedException e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); return false; } } diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index 674eaf9..efdbdfb 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -48,6 +48,8 @@ import btools.util.CheapRuler; public class BRouterView extends View { + private static final String TAG = "BRouterView"; + private final int memoryClass; RoutingEngine cr; private int imgw; @@ -148,8 +150,8 @@ public class BRouterView extends View { try { td.mkdirs(); } catch (Exception e) { - Log.d("BRouterView", "Error creating base directory: " + e.getMessage()); - e.printStackTrace(); + Log.d(TAG, "Error creating base directory: " + e.getMessage()); + Log.e(TAG, Log.getStackTraceString(e)); } if (!td.isDirectory()) { @@ -173,7 +175,7 @@ public class BRouterView extends View { // new init is done move old files if (waitingForMigration) { - Log.d("BR", "path " + oldMigrationPath + " " + basedir); + Log.d(TAG, "path " + oldMigrationPath + " " + basedir); Thread t = new Thread(new Runnable() { @Override public void run() { @@ -184,7 +186,7 @@ public class BRouterView extends View { try { t.join(500); } catch (InterruptedException e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); } waitingForMigration = false; } @@ -333,9 +335,9 @@ public class BRouterView extends View { out.close(); } catch (FileNotFoundException fileNotFoundException) { - Log.e("tag", fileNotFoundException.getMessage()); + Log.e(TAG, fileNotFoundException.getMessage()); } catch (Exception e) { - Log.e("tag", e.getMessage()); + Log.e(TAG, e.getMessage()); } } diff --git a/brouter-routing-app/src/main/java/btools/routingapp/RoutingParameterDialog.java b/brouter-routing-app/src/main/java/btools/routingapp/RoutingParameterDialog.java index 04c2d17..d69a037 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/RoutingParameterDialog.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/RoutingParameterDialog.java @@ -7,6 +7,7 @@ import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; +import android.util.Log; import android.window.OnBackInvokedCallback; import android.window.OnBackInvokedDispatcher; @@ -146,7 +147,7 @@ public class RoutingParameterDialog extends AppCompatActivity { list.add(p); } } catch (Exception e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); } } } while (line != null); @@ -278,7 +279,7 @@ public class RoutingParameterDialog extends AppCompatActivity { sparams = i.getExtras().getString("PARAMS_VALUES", ""); } } catch (Exception e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); } getPreferenceManager().setSharedPreferencesName("prefs_profile_" + profile_hash); diff --git a/brouter-routing-app/src/main/java/btools/routingapp/ServerConfig.java b/brouter-routing-app/src/main/java/btools/routingapp/ServerConfig.java index 0d83d49..a059a19 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/ServerConfig.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/ServerConfig.java @@ -2,6 +2,7 @@ package btools.routingapp; import android.content.Context; import android.content.res.AssetManager; +import android.util.Log; import java.io.BufferedReader; import java.io.File; @@ -13,6 +14,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class ServerConfig { + + private static final String TAG = "ServerConfig"; + private static String mServerConfigName = "serverconfig.txt"; private String mSegmentUrl = "https://brouter.de/brouter/segments4/"; @@ -52,7 +56,7 @@ public class ServerConfig { } } } catch (IOException e) { - e.printStackTrace(); + Log.e(TAG, Log.getStackTraceString(e)); } finally { try { if (br != null) br.close();