mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Fixed up logging of Exceptions
Added stack traces to the logs, which helps for debugging.
This commit is contained in:
parent
1868103380
commit
84cb69d170
7 changed files with 10 additions and 22 deletions
|
|
@ -150,9 +150,9 @@ public class HabiticaApplication extends Application {
|
|||
Field field = FlowManager.class.getDeclaredField("mDatabaseHolder");
|
||||
setFinalStatic(field, null);
|
||||
} catch (NoSuchFieldException noSuchField) {
|
||||
Log.e("nosuchfield", "No such field exists in FlowManager");
|
||||
Log.e("nosuchfield", "No such field exists in FlowManager", noSuchField);
|
||||
} catch (IllegalAccessException illegalAccess) {
|
||||
Log.e("illegalaccess", "Illegal access of FlowManager");
|
||||
Log.e("illegalaccess", "Illegal access of FlowManager", illegalAccess);
|
||||
}
|
||||
|
||||
FlowManager.init(context);
|
||||
|
|
@ -172,7 +172,7 @@ public class HabiticaApplication extends Application {
|
|||
File dbFile = context.getDatabasePath(databaseName);
|
||||
return dbFile.exists();
|
||||
} catch (Exception exception) {
|
||||
Log.e(exception.toString(), "Database %s doesn't exist.");
|
||||
Log.e("DbExists", "Database %s doesn't exist.", exception);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class LoginActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
public void onError(FacebookException exception) {
|
||||
Log.d("FB Login", "Error");
|
||||
Log.e("FB Login", "Error", exception);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ public class LoginActivity extends AppCompatActivity
|
|||
Log.d("scanresult", scanResult.getContents());
|
||||
this.parse(scanResult.getContents());
|
||||
} catch(Exception e) {
|
||||
|
||||
Log.e("scanresult", "Could not parse scanResult", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package com.habitrpg.android.habitica.callbacks;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.habitrpg.android.habitica.events.TaskCreatedEvent;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
|
|
@ -23,6 +20,6 @@ public class TaskCreationCallback implements Callback<Task> {
|
|||
|
||||
@Override
|
||||
public void failure(RetrofitError error) {
|
||||
Log.w("HabitCreation", "Error " + error.getMessage());
|
||||
Log.w("HabitCreation", "Error", error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.habitrpg.android.habitica.callbacks;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
@ -29,7 +26,7 @@ public class TaskDeletionCallback implements Callback<Void> {
|
|||
@Override
|
||||
public void failure(RetrofitError error) {
|
||||
callback.onTaskDeletionFail();
|
||||
Log.w("HabitDeletion", "Error " + error.getMessage());
|
||||
Log.w("HabitDeletion", "Error", error);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
package com.habitrpg.android.habitica.callbacks;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.TaskDirectionData;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction;
|
||||
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener;
|
||||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
@ -57,7 +54,7 @@ public class TaskScoringCallback implements Callback<TaskDirectionData> {
|
|||
@Override
|
||||
public void failure(RetrofitError error) {
|
||||
this.mCallback.onTaskScoringFailed();
|
||||
Log.w("TaskScoring", "Task scoring failed " + error.getMessage());
|
||||
Log.w("TaskScoring", "Task scoring failed", error);
|
||||
}
|
||||
|
||||
public interface OnTaskScored {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package com.habitrpg.android.habitica.callbacks;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.habitrpg.android.habitica.events.TaskUpdatedEvent;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
|
|
@ -25,7 +22,7 @@ public class TaskUpdateCallback implements Callback<Task> {
|
|||
|
||||
@Override
|
||||
public void failure(RetrofitError error) {
|
||||
Log.w("HabitUpdate", "Error " + error.getMessage());
|
||||
Log.w("HabitUpdate", "Error", error);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ public class IntentIntegrator {
|
|||
activity.startActivity(intent);
|
||||
} catch (ActivityNotFoundException anfe) {
|
||||
// Hmm, market is not installed
|
||||
Log.w(TAG, "Google Play is not installed; cannot install " + packageName);
|
||||
Log.w(TAG, "Google Play is not installed; cannot install " + packageName, anfe);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue