mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 01:16:40 +00:00
Use app specific file names for logging
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<string name="log_file_template" translatable="false">sap_log_%s.txt</string>
|
||||
<string name="crash_file_name" translatable="false">sap_crash_%s.txt</string>
|
||||
<string name="options_menu_live">Connection Information</string>
|
||||
<string name="remove">Remove</string>
|
||||
<string name="enter_new_item">Enter new item</string>
|
||||
|
||||
+3
-1
@@ -14,13 +14,14 @@ import java.util.concurrent.BlockingQueue;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.sap.sailing.android.shared.R;
|
||||
import com.sap.sailing.android.shared.util.FileHandlerUtils;
|
||||
|
||||
public class FileLoggingTask implements Runnable {
|
||||
|
||||
private final static String TAG = FileLoggingTask.class.getName();
|
||||
|
||||
private final static String logFileTemplate = "sap_rc_log_%s.txt";
|
||||
private static String logFileTemplate;
|
||||
private final static String logFileDateFormat = "yyyyMMdd";
|
||||
|
||||
private final BlockingQueue<String> queue;
|
||||
@@ -34,6 +35,7 @@ public class FileLoggingTask implements Runnable {
|
||||
public FileLoggingTask(BlockingQueue<String> queue, Context context) {
|
||||
this.queue = queue;
|
||||
this.context = context.getApplicationContext();
|
||||
logFileTemplate = this.context.getString(R.string.log_file_template);
|
||||
}
|
||||
|
||||
public FileLoggingTask(Context context) {
|
||||
|
||||
+3
-1
@@ -6,6 +6,8 @@ import java.util.Date;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.sap.sailing.android.shared.R;
|
||||
|
||||
public class LoggingExceptionHandler implements UncaughtExceptionHandler {
|
||||
|
||||
private static final String TAG = LoggingExceptionHandler.class.getName();
|
||||
@@ -20,7 +22,7 @@ public class LoggingExceptionHandler implements UncaughtExceptionHandler {
|
||||
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
FileLoggingTask task = new FileLoggingTask(context);
|
||||
if (task.tryStartFileLogging("sap_rc_crash_%s.txt")) {
|
||||
if (task.tryStartFileLogging(context.getString(R.string.crash_file_name))) {
|
||||
task.log(String.format("%s - Exception occured on thread %s:", new Date(), thread.getId()));
|
||||
task.logException(ex);
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<string name="empty"></string>
|
||||
<string name="log_file_template" translatable="false">sap_insight_log_%s.txt</string>
|
||||
<string name="crash_file_name" translatable="false">sap_insight_crash_%s.txt</string>
|
||||
<string name="app_name">SAP Sail InSight</string>
|
||||
<string name="options_menu_settings">Settings</string>
|
||||
<string name="options_menu_checkout">Checkout</string>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<resources>
|
||||
|
||||
<string name="app_name" translatable="false">SAP Buoy Pinger</string>
|
||||
<string name="log_file_template" translatable="false">sap_buoy_log_%s.txt</string>
|
||||
<string name="crash_file_name" translatable="false">sap_buoy_crash_%s.txt</string>
|
||||
<string name="title_activity_start" translatable="false">SAP Buoy Pinger</string>
|
||||
<string name="course_type">Course Type</string>
|
||||
<string name="marks">Marks</string>
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
<string-array name="empty_array" tools:ignore="UnusedResources"/>
|
||||
<string name="empty"></string>
|
||||
<string name="log_file_template" translatable="false">sap_rc_log_%s.txt</string>
|
||||
<string name="crash_file_name" translatable="false">sap_rc_crash_%s.txt</string>
|
||||
|
||||
<string name="intent_update_ui" translatable="false">com.sap.sailing.racecommittee.intent.update-ui</string>
|
||||
<string name="intent_update_ui_data" translatable="false">com.sap.sailing.racecommittee.intent.update-ui.data</string>
|
||||
|
||||
Reference in New Issue
Block a user