diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java index 98bc3489..eae160fd 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java @@ -199,7 +199,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap try { // to get current account from SingleAccountHelper selectAccount(SingleAccountHelper.getCurrentSingleSignOnAccount(getApplicationContext()).name); - Log.v("Notes", "NextcloudRequest account: " + localAccount); + Log.v(getClass().getSimpleName(), "NextcloudRequest account: " + localAccount); } catch (NextcloudFilesAppAccountNotFoundException e) { e.printStackTrace(); } catch (NoCurrentAccountSelectedException e) { @@ -583,7 +583,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap db.deleteNoteAndSync((dbNote).getId()); adapter.remove(dbNote); refreshLists(); - Log.v("Note", "Item deleted through swipe ----------------------------------------------"); + Log.v(getClass().getSimpleName(), "Item deleted through swipe ----------------------------------------------"); Snackbar.make(swipeRefreshLayout, R.string.action_note_deleted, Snackbar.LENGTH_LONG) .setAction(R.string.action_undo, (View v) -> { db.addNoteAndSync(dbNote.getAccountId(), dbNote); @@ -741,7 +741,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap super.onActivityResult(requestCode, resultCode, data); AccountImporter.onActivityResult(requestCode, resultCode, data, this, (SingleSignOnAccount account) -> { - Log.v("Notes", "Added account: " + "name:" + account.name + ", " + account.url + ", userId" + account.userId); + Log.v(getClass().getSimpleName(), "Added account: " + "name:" + account.name + ", " + account.url + ", userId" + account.userId); db.addAccount(account.url, account.userId, account.name); selectAccount(account.name); clickHeader(); @@ -801,7 +801,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap .load(R.mipmap.ic_launcher) .apply(RequestOptions.circleCropTransform()) .into(this.currentAccountImage); - e.printStackTrace(); + Log.w(getClass().getSimpleName(), "Tried to update username in drawer, but localAccount was null"); } } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/PreferencesFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/PreferencesFragment.java index 99d6a62d..dba2218e 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/PreferencesFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/PreferencesFragment.java @@ -37,7 +37,7 @@ public class PreferencesFragment extends PreferenceFragment { final SwitchPreference wifiOnlyPref = (SwitchPreference) findPreference(getString(R.string.pref_key_wifi_only)); wifiOnlyPref.setOnPreferenceChangeListener((Preference preference, Object newValue) -> { Boolean syncOnWifiOnly = (Boolean) newValue; - Log.v("Notes", "syncOnWifiOnly: " + syncOnWifiOnly); + Log.v(getClass().getSimpleName(), "syncOnWifiOnly: " + syncOnWifiOnly); return true; }); } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java index 0ccb09e0..c7241574 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java @@ -306,7 +306,7 @@ public class NoteSQLiteOpenHelper extends SQLiteOpenHelper { private List getNotesCustom(long accountId, @NonNull String selection, @NonNull String[] selectionArgs, @Nullable String orderBy, @Nullable String limit) { SQLiteDatabase db = getReadableDatabase(); if (selectionArgs.length > 2) { - Log.v("Note", selection + " ---- " + selectionArgs[0] + " " + selectionArgs[1] + " " + selectionArgs[2]); + Log.v(getClass().getSimpleName(), selection + " ---- " + selectionArgs[0] + " " + selectionArgs[1] + " " + selectionArgs[2]); } Cursor cursor = db.query(table_notes, columns, selection, selectionArgs, null, null, orderBy, limit); List notes = new ArrayList<>(); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java index 4a934ea2..79f84dc6 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java @@ -101,7 +101,7 @@ public class NoteServerSyncHelper { try { this.localAccount = db.getLocalAccountByAccountName(SingleAccountHelper.getCurrentSingleSignOnAccount(appContext).name); notesClient = new NotesClient(appContext); - Log.v("Notes", "NextcloudRequest account: " + localAccount); + Log.v(getClass().getSimpleName(), "NextcloudRequest account: " + localAccount); } catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) { e.printStackTrace(); } @@ -127,11 +127,11 @@ public class NoteServerSyncHelper { } else { notesClient.updateAccount(); } - Log.v("Notes", "NextcloudRequest account: " + localAccount); + Log.v(getClass().getSimpleName(), "NextcloudRequest account: " + localAccount); } catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) { e.printStackTrace(); } - Log.v("Note", "Reinstanziation NotesClient because of SSO acc changed"); + Log.v(getClass().getSimpleName(), "Reinstanziation NotesClient because of SSO acc changed"); } @Override diff --git a/app/src/main/java/it/niedermann/owncloud/notes/util/NotesClient.java b/app/src/main/java/it/niedermann/owncloud/notes/util/NotesClient.java index 2b420833..ba5c8c04 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/util/NotesClient.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/util/NotesClient.java @@ -78,11 +78,11 @@ public class NotesClient { this.context = context; try { SingleSignOnAccount ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(context); - Log.v("Notes", "NextcloudRequest account: " + ssoAccount.name); + Log.v(getClass().getSimpleName(), "NextcloudRequest account: " + ssoAccount.name); mNextcloudAPI = new NextcloudAPI(context, ssoAccount, new GsonBuilder().create(), new NextcloudAPI.ApiConnectedListener() { @Override public void onConnected() { - Log.v("Notes", "SSO API connected"); + Log.v(getClass().getSimpleName(), "SSO API connected"); } @Override @@ -101,11 +101,11 @@ public class NotesClient { } try { SingleSignOnAccount ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(context); - Log.v("Notes", "NextcloudRequest account: " + ssoAccount.name); + Log.v(getClass().getSimpleName(), "NextcloudRequest account: " + ssoAccount.name); mNextcloudAPI = new NextcloudAPI(context, ssoAccount, new GsonBuilder().create(), new NextcloudAPI.ApiConnectedListener() { @Override public void onConnected() { - Log.v("Notes", "SSO API connected"); + Log.v(getClass().getSimpleName(), "SSO API connected"); } @Override @@ -194,9 +194,9 @@ public class NotesClient { StringBuilder result = new StringBuilder(); try { - Log.v("Notes", "NextcloudRequest: " + nextcloudRequest.toString()); + Log.v(getClass().getSimpleName(), "NextcloudRequest: " + nextcloudRequest.toString()); InputStream inputStream = mNextcloudAPI.performNetworkRequest(nextcloudRequest); - Log.v("Notes", "NextcloudRequest: " + nextcloudRequest.toString()); + Log.v(getClass().getSimpleName(), "NextcloudRequest: " + nextcloudRequest.toString()); BufferedReader rd = new BufferedReader(new InputStreamReader(inputStream)); String line; while ((line = rd.readLine()) != null) {