Extra logging option

pull/194/head
M66B 4 years ago
parent 8ed239bd53
commit 7603d32a33

@ -109,8 +109,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Button btnMore;
private SwitchCompat swProtocol;
private SwitchCompat swLogInfo;
private SwitchCompat swDebug;
private SwitchCompat swInfo;
private SwitchCompat swExpunge;
private SwitchCompat swAuthPlain;
private SwitchCompat swAuthLogin;
@ -206,8 +206,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
btnMore = view.findViewById(R.id.btnMore);
swProtocol = view.findViewById(R.id.swProtocol);
swLogInfo = view.findViewById(R.id.swLogInfo);
swDebug = view.findViewById(R.id.swDebug);
swInfo = view.findViewById(R.id.swInfo);
swExpunge = view.findViewById(R.id.swExpunge);
swAuthPlain = view.findViewById(R.id.swAuthPlain);
swAuthLogin = view.findViewById(R.id.swAuthLogin);
@ -469,18 +469,18 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
swLogInfo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("debug", checked).apply();
grpDebug.setVisibility(checked || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
prefs.edit().putInt("log_level", checked ? android.util.Log.INFO : android.util.Log.WARN).apply();
}
});
swInfo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
swDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putInt("log_level", checked ? android.util.Log.INFO : android.util.Log.WARN).apply();
prefs.edit().putBoolean("debug", checked).apply();
grpDebug.setVisibility(checked || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
}
});
@ -875,8 +875,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swCleanupAttachments.setChecked(prefs.getBoolean("cleanup_attachments", false));
swProtocol.setChecked(prefs.getBoolean("protocol", false));
swLogInfo.setChecked(prefs.getInt("log_level", Log.getDefaultLogLevel()) <= android.util.Log.INFO);
swDebug.setChecked(prefs.getBoolean("debug", false));
swInfo.setChecked(prefs.getInt("log_level", Log.getDefaultLogLevel()) <= android.util.Log.INFO);
swExpunge.setChecked(prefs.getBoolean("perform_expunge", true));
swAuthPlain.setChecked(prefs.getBoolean("auth_plain", true));
swAuthLogin.setChecked(prefs.getBoolean("auth_login", true));

@ -482,6 +482,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swProtocol" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLogInfo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_log_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvProtocolHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDebug"
android:layout_width="0dp"
@ -490,7 +501,7 @@
android:text="@string/title_advanced_debug"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvProtocolHint"
app:layout_constraintTop_toBottomOf="@id/swLogInfo"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
@ -506,17 +517,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDebug" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swInfo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_log_level"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swExpunge"
android:layout_width="0dp"
@ -526,7 +526,7 @@
android:text="@string/title_advanced_expunge"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swInfo"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
@ -664,6 +664,6 @@
android:id="@+id/grpDebug"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="swInfo,swExpunge,swAuthPlain,swAuthLogin,swAuthNtlm,swAuthSasl,tvProcessors,tvMemoryClass,tvMemoryUsage,tvStorageUsage,tvFingerprint,btnCharsets,btnCiphers,btnFiles" />
app:constraint_referenced_ids="swExpunge,swAuthPlain,swAuthLogin,swAuthNtlm,swAuthSasl,tvProcessors,tvMemoryClass,tvMemoryUsage,tvStorageUsage,tvFingerprint,btnCharsets,btnCiphers,btnFiles" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

@ -536,8 +536,8 @@
<string name="title_advanced_wal">WAL (debug only)</string>
<string name="title_advanced_crash_reports">Send error reports</string>
<string name="title_advanced_protocol">Protocol logging</string>
<string name="title_advanced_log_info">Extra logging</string>
<string name="title_advanced_debug">Debug mode</string>
<string name="title_advanced_log_level" translatable="false">Log info (debug only)</string>
<string name="title_advanced_cleanup_attachments">Delete attachments of old messages</string>
<string name="title_advanced_cleanup">Cleanup</string>
<string name="title_advanced_last_cleanup">Last cleanup: %1$s</string>

Loading…
Cancel
Save