mirror of https://github.com/M66B/FairEmail.git
Even more search logging
This commit is contained in:
parent
c71b963e12
commit
b4f867b86f
|
@ -453,7 +453,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
ProtocolException pex = new ProtocolException(
|
ProtocolException pex = new ProtocolException(
|
||||||
"Search unicode " + account.host + " " + criteria, ex);
|
"Search unicode " + account.host + " " + criteria, ex);
|
||||||
EntityLog.log(context, pex.toString());
|
EntityLog.log(context, pex.toString());
|
||||||
Log.e(pex);
|
//Log.e(pex);
|
||||||
// Fallback to ASCII search
|
// Fallback to ASCII search
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,23 +475,25 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
ProtocolException pex = new ProtocolException(
|
ProtocolException pex = new ProtocolException(
|
||||||
"Search " + account.host + " " + criteria, ex);
|
"Search " + account.host + " " + criteria, ex);
|
||||||
EntityLog.log(context, pex.toString());
|
EntityLog.log(context, pex.toString());
|
||||||
Log.e(pex);
|
//Log.e(pex);
|
||||||
throw pex;
|
throw pex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
state.imessages = (Message[]) result;
|
state.imessages = (Message[]) result;
|
||||||
|
EntityLog.log(context, "Boundary found messages=" + state.imessages.length);
|
||||||
}
|
}
|
||||||
Log.i("Boundary server found messages=" + state.imessages.length);
|
Log.i("Boundary server found messages=" + state.imessages.length);
|
||||||
|
|
||||||
state.index = state.imessages.length - 1;
|
state.index = state.imessages.length - 1;
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
state.error = true;
|
state.error = true;
|
||||||
if (ex instanceof FolderClosedException)
|
EntityLog.log(context, ex.toString());
|
||||||
Log.w("Search", ex);
|
//if (ex instanceof FolderClosedException)
|
||||||
else
|
// Log.w("Search", ex);
|
||||||
Log.e("Search", ex);
|
//else
|
||||||
|
// Log.e("Search", ex);
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +501,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
|
|
||||||
int found = 0;
|
int found = 0;
|
||||||
while (state.index >= 0 && found < pageSize && !state.destroyed) {
|
while (state.index >= 0 && found < pageSize && !state.destroyed) {
|
||||||
Log.i("Boundary server index=" + state.index);
|
EntityLog.log(context, "Boundary server index=" + state.index);
|
||||||
int from = Math.max(0, state.index - (pageSize - found) + 1);
|
int from = Math.max(0, state.index - (pageSize - found) + 1);
|
||||||
Message[] isub = Arrays.copyOfRange(state.imessages, from, state.index + 1);
|
Message[] isub = Arrays.copyOfRange(state.imessages, from, state.index + 1);
|
||||||
state.index -= (pageSize - found);
|
state.index -= (pageSize - found);
|
||||||
|
@ -519,7 +521,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
add.add(m);
|
add.add(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i("Boundary fetching " + add.size() + "/" + isub.length);
|
EntityLog.log(context, "Boundary fetching " + add.size() + "/" + isub.length);
|
||||||
if (add.size() > 0) {
|
if (add.size() > 0) {
|
||||||
FetchProfile fp = new FetchProfile();
|
FetchProfile fp = new FetchProfile();
|
||||||
fp.add(FetchProfile.Item.ENVELOPE);
|
fp.add(FetchProfile.Item.ENVELOPE);
|
||||||
|
@ -554,8 +556,11 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
rules, astate);
|
rules, astate);
|
||||||
found++;
|
found++;
|
||||||
}
|
}
|
||||||
if (message != null && criteria != null /* browsed */)
|
if (message != null && criteria != null /* browsed */) {
|
||||||
|
EntityLog.log(context, "Boundary server found uid=" + uid);
|
||||||
db.message().setMessageFound(message.id);
|
db.message().setMessageFound(message.id);
|
||||||
|
} else
|
||||||
|
EntityLog.log(context, "Boundary server browsed uid=" + uid);
|
||||||
} catch (MessageRemovedException ex) {
|
} catch (MessageRemovedException ex) {
|
||||||
EntityLog.log(context, browsable.name + " boundary server ex=" + ex);
|
EntityLog.log(context, browsable.name + " boundary server ex=" + ex);
|
||||||
Log.w(browsable.name + " boundary server", ex);
|
Log.w(browsable.name + " boundary server", ex);
|
||||||
|
@ -583,7 +588,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i("Boundary server done");
|
EntityLog.log(context, "Boundary server done");
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue