From 41e78c168ec53c46236163052827a19c75d656b9 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 6 Sep 2012 12:42:47 -0700 Subject: [PATCH] Clean up imap2 logging Change-Id: I53b522ea33d8bb1b070d994fd765d1eec2f60fb4 --- src/com/android/email/imap2/Imap2SyncService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/android/email/imap2/Imap2SyncService.java b/src/com/android/email/imap2/Imap2SyncService.java index 871f0722f..5c42a1375 100644 --- a/src/com/android/email/imap2/Imap2SyncService.java +++ b/src/com/android/email/imap2/Imap2SyncService.java @@ -204,7 +204,7 @@ public class Imap2SyncService extends AbstractSyncService { Cursor deletes = getDeletesCursor(); try { if (mRequestQueue.isEmpty() && updates == null && deletes == null) { - userLog("Ping: nothing to do"); + userLog("Alarm: nothing to do"); } else { int cnt = mRequestQueue.size(); if (updates != null) { @@ -213,7 +213,7 @@ public class Imap2SyncService extends AbstractSyncService { if (deletes != null) { cnt += deletes.getCount(); } - userLog("Ping: " + cnt + " tasks"); + userLog("Alarm: " + cnt + " tasks"); ping(); } } finally { @@ -318,6 +318,8 @@ public class Imap2SyncService extends AbstractSyncService { String tag = "@@a" + t + ' '; if (!cmd.startsWith("login")) { userLog(tag + cmd); + } else { + userLog("login [redacted]"); } out.write(tag); out.write(cmd); @@ -398,7 +400,7 @@ public class Imap2SyncService extends AbstractSyncService { mImapResponse = new ArrayList(); while (true) { str = r.readLine(); - userLog("< " + str); + userLog("< " + ((str.length() > 80) ? str.substring(0, 80) + " ..." : str)); if (caseInsensitiveStartsWith(str, tag)) { // This is the response from the command named 'tag' Parser p = new Parser(str, tag.length() - 1); @@ -1186,7 +1188,7 @@ public class Imap2SyncService extends AbstractSyncService { if (conn.status == EXIT_DONE) { mBodyThread = new BodyThread(conn, unloaded); mBodyThread.start(); - userLog("***** Starting mBodyThread " + mBodyThread.getId()); + userLog("Starting mBodyThread " + mBodyThread.getId()); } else { // fetchMessageData closes the cursor fetchMessageData(mConnection, unloaded); @@ -2178,6 +2180,7 @@ public class Imap2SyncService extends AbstractSyncService { // Don't kill the connection until mBodyThread is done... if (mBodyThread != null) { try { + userLog("BodyThread running; wait for finish..."); mBodyThread.join(); } catch (InterruptedException e) { // Just finish...