Improved logging

This commit is contained in:
M66B 2022-08-14 07:24:57 +02:00
parent ed93b3a432
commit fccc0d215b
2 changed files with 8 additions and 2 deletions

View File

@ -81,7 +81,10 @@ public class GmailState {
EntityLog.log(context, EntityLog.Type.Debug, "Token needs refresh" +
" user=" + id + ":" + user + " ago=" + (ago / 60 / 1000L) + " min");
if (ago < ServiceAuthenticator.MIN_FORCE_REFRESH_INTERVAL) {
Log.e("Blocked token refresh id=" + id + " ago=" + (ago / 1000L) + " s");
Log.e("Blocked token refresh id=" + id +
" ago=" + (ago / 1000L) + " s" +
" force=" + forceRefresh +
" exp=" + (expiration == null ? null : new Date(expiration)));
return;
}
prefs.edit().putLong(key, now).apply();

View File

@ -178,7 +178,10 @@ public class ServiceAuthenticator extends Authenticator {
EntityLog.log(context, EntityLog.Type.Debug, "Token needs refresh" +
" user=" + id + ":" + user + " ago=" + (ago / 60 / 1000L) + " min");
if (ago < ServiceAuthenticator.MIN_FORCE_REFRESH_INTERVAL) {
Log.e("Blocked token refresh id=" + id + " ago=" + (ago / 1000L) + " s");
Log.e("Blocked token refresh id=" + id +
" ago=" + (ago / 1000L) + " s" +
" force=" + forceRefresh +
" exp=" + (expiration == null ? null : new Date(expiration)));
return;
}
prefs.edit().putLong(key, now).apply();