Added logging

This commit is contained in:
M66B 2022-03-14 16:24:40 +01:00
parent d07e1ffcc2
commit eb5c349951
1 changed files with 2 additions and 1 deletions

View File

@ -521,13 +521,14 @@ public class EmailService implements AutoCloseable {
String key = "dns." + host;
try {
main = InetAddress.getByName(host);
EntityLog.log(context, "Resolved " + main);
prefs.edit().putString(key, main.getHostAddress()).apply();
} catch (UnknownHostException ex) {
String last = prefs.getString(key, null);
if (TextUtils.isEmpty(last))
throw new MessagingException(ex.getMessage(), ex);
else {
Log.w("Using " + key + "=" + last);
EntityLog.log(context, "Using " + key + "=" + last);
main = InetAddress.getByName(last);
}
}