Skip to content

Commit

Permalink
changed printStackTrace to log
Browse files Browse the repository at this point in the history
  • Loading branch information
afischerdev committed Jul 12, 2024
1 parent f289b0c commit 1f2f655
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

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;
Expand Down Expand Up @@ -216,7 +218,7 @@ public void downloadAll(ArrayList<Integer> downloadList, int all) {
Object data;
Toast.makeText(this, R.string.msg_too_much_data, Toast.LENGTH_LONG).show();

e.printStackTrace();
Log.e(TAG, Log.getStackTraceString(e));
return;
}

Expand All @@ -242,10 +244,9 @@ public void downloadAll(ArrayList<Integer> downloadList, int all) {
//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
Expand Down Expand Up @@ -516,10 +517,10 @@ private boolean isDownloadRunning(Class<?> serviceClass) {
}
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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

public class BRouterView extends View {

private static final String TAG = "BRouterView";

private final int memoryClass;
RoutingEngine cr;
private int imgw;
Expand Down Expand Up @@ -148,8 +150,8 @@ public void startSetup(File baseDir, boolean storeBasedir, boolean silent) {
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()) {
Expand All @@ -173,7 +175,7 @@ public void startSetup(File baseDir, boolean storeBasedir, boolean silent) {

// 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() {
Expand All @@ -184,7 +186,7 @@ public void run() {
try {
t.join(500);
} catch (InterruptedException e) {
e.printStackTrace();
Log.e(TAG, Log.getStackTraceString(e));
}
waitingForMigration = false;
}
Expand Down Expand Up @@ -333,9 +335,9 @@ private void copyFile(String inputPath, String inputFile, String outputPath) {
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());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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;

Expand Down Expand Up @@ -146,7 +147,7 @@ static public List<RoutingParam> getParamsFromProfile(final InputStream fis) thr
list.add(p);
}
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, Log.getStackTraceString(e));
}
}
} while (line != null);
Expand Down Expand Up @@ -278,7 +279,7 @@ public void onCreate(Bundle savedInstanceState) {
sparams = i.getExtras().getString("PARAMS_VALUES", "");
}
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, Log.getStackTraceString(e));
}

getPreferenceManager().setSharedPreferencesName("prefs_profile_" + profile_hash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;

import java.io.BufferedReader;
import java.io.File;
Expand All @@ -13,6 +14,9 @@
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/";
Expand Down Expand Up @@ -52,7 +56,7 @@ private void readConfigFile(File file) {
}
}
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, Log.getStackTraceString(e));
} finally {
try {
if (br != null) br.close();
Expand Down

0 comments on commit 1f2f655

Please sign in to comment.