Log fail-safe

pull/187/head
M66B 5 years ago
parent 9b5b7bba1c
commit b4ad4d72d3

@ -528,18 +528,22 @@ public class EmailService implements AutoCloseable {
@Override @Override
public void write(int b) { public void write(int b) {
try {
if (((char) b) == '\n') { if (((char) b) == '\n') {
String line = bos.toString(); String line = bos.toString();
if (!line.endsWith("ignoring socket timeout")) if (!line.endsWith("ignoring socket timeout"))
if (debug) if (log)
android.util.Log.i("javamail", user + " " + line);
else
EntityLog.log(context, user + " " + line); EntityLog.log(context, user + " " + line);
else
android.util.Log.i("javamail", user + " " + line);
bos.reset(); bos.reset();
} else } else
bos.write(b); bos.write(b);
} catch (Throwable ex) {
Log.e(ex);
}
} }
})); }, true));
//System.setProperty("mail.socket.debug", Boolean.toString(debug)); //System.setProperty("mail.socket.debug", Boolean.toString(debug));
isession.addProvider(new GmailSSLProvider()); isession.addProvider(new GmailSSLProvider());

Loading…
Cancel
Save