Adjust logging to info level

Signed-off-by: stefan-niedermann <info@niedermann.it>
This commit is contained in:
stefan-niedermann 2020-03-13 22:38:26 +01:00
parent a94d9d0b47
commit 9233a57785
2 changed files with 13 additions and 9 deletions

View file

@ -29,13 +29,17 @@ public class PreferencesFragment extends PreferenceFragmentCompat {
addPreferencesFromResource(R.xml.preferences);
final SwitchPreference lockPref = findPreference(getString(R.string.pref_key_lock));
if (!DeviceCredentialUtil.areCredentialsAvailable(getContext())) {
lockPref.setVisible(false);
if (lockPref != null) {
if (!DeviceCredentialUtil.areCredentialsAvailable(requireContext())) {
lockPref.setVisible(false);
} else {
lockPref.setOnPreferenceChangeListener((preference, newValue) -> {
Notes.setLockedPreference((Boolean) newValue);
return true;
});
}
} else {
lockPref.setOnPreferenceChangeListener((preference, newValue) -> {
Notes.setLockedPreference((Boolean) newValue);
return true;
});
Log.e(TAG, "Could not find \"" + getString(R.string.pref_key_lock) + "\"-preference.");
}
final ListPreference themePref = findPreference(getString(R.string.pref_key_theme));
@ -50,14 +54,14 @@ public class PreferencesFragment extends PreferenceFragmentCompat {
final SwitchPreference wifiOnlyPref = findPreference(getString(R.string.pref_key_wifi_only));
assert wifiOnlyPref != null;
wifiOnlyPref.setOnPreferenceChangeListener((preference, newValue) -> {
Log.v(TAG, "syncOnWifiOnly: " + newValue);
Log.i(TAG, "syncOnWifiOnly: " + newValue);
return true;
});
final ListPreference syncPref = findPreference(getString(R.string.pref_key_background_sync));
assert syncPref != null;
syncPref.setOnPreferenceChangeListener((preference, newValue) -> {
Log.v(TAG, "syncPref: " + preference + " - newValue: " + newValue);
Log.i(TAG, "syncPref: " + preference + " - newValue: " + newValue);
SyncWorker.update(requireContext(), newValue.toString());
return true;
});

View file

@ -60,7 +60,7 @@ public class Notes extends Application {
}
public static void setLockedPreference(boolean lockedPreference) {
Log.d(TAG, "New locked preference: " + lockedPreference);
Log.i(TAG, "New locked preference: " + lockedPreference);
Notes.lockedPreference = lockedPreference;
}