mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Enabled tracing when logging is enabled
This commit is contained in:
parent
feb772ccb5
commit
1190111069
1 changed files with 6 additions and 2 deletions
|
@ -109,6 +109,7 @@ public class EmailService implements AutoCloseable {
|
|||
private String ehlo;
|
||||
private boolean log;
|
||||
private boolean debug;
|
||||
private int level;
|
||||
private Properties properties;
|
||||
private Session isession;
|
||||
private Service iservice;
|
||||
|
@ -180,6 +181,7 @@ public class EmailService implements AutoCloseable {
|
|||
else if (protocol_since + PROTOCOL_LOG_DURATION < now)
|
||||
prefs.edit().putBoolean("protocol", false).apply();
|
||||
this.log = prefs.getBoolean("protocol", false);
|
||||
this.level = prefs.getInt("log_level", Log.getDefaultLogLevel());
|
||||
this.harden = prefs.getBoolean("ssl_harden", false);
|
||||
|
||||
boolean auth_plain = prefs.getBoolean("auth_plain", true);
|
||||
|
@ -680,8 +682,10 @@ public class EmailService implements AutoCloseable {
|
|||
|
||||
breadcrumbs = new RingBuffer<>(BREADCRUMBS_SIZE);
|
||||
|
||||
isession.setDebug(debug || log);
|
||||
if (debug || log)
|
||||
boolean trace = (debug || log || level <= android.util.Log.INFO);
|
||||
|
||||
isession.setDebug(trace);
|
||||
if (trace)
|
||||
isession.setDebugOut(new PrintStream(new OutputStream() {
|
||||
private ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
|
|
Loading…
Reference in a new issue