From: Xavier Ducrohet Date: Thu, 3 Sep 2009 01:03:01 +0000 (-0700) Subject: Make DDMS log way less verbose. X-Git-Tag: android-x86-2.2~251^2~264 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7ab724a2d101fb390a2622c3f0c90405c91f78fb;p=android-x86%2Fsdk.git Make DDMS log way less verbose. All the Log.i() calls were in fact debug logging, so I moved them to Log.d() Change-Id: I47b9cd8e85e630d61506c8c2df3baf245a706e03 --- diff --git a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java index befb9948d..614573350 100644 --- a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java +++ b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java @@ -138,7 +138,7 @@ public class DeviceCommandDialog extends Dialog { shell.addListener(SWT.Close, new Listener() { public void handleEvent(Event event) { if (!mFinished) { - Log.i("ddms", "NOT closing - cancelling command"); + Log.d("ddms", "NOT closing - cancelling command"); event.doit = false; mCancel = true; } @@ -354,7 +354,7 @@ public class DeviceCommandDialog extends Dialog { PrefsDialog.getStore().setValue("lastTextSaveDir", dlg.getFilterPath()); - Log.i("ddms", "Saving output to " + fileName); + Log.d("ddms", "Saving output to " + fileName); /* * Convert to 8-bit characters. diff --git a/ddms/app/src/com/android/ddms/DropdownSelectionListener.java b/ddms/app/src/com/android/ddms/DropdownSelectionListener.java index 99d63ceac..04d921c49 100644 --- a/ddms/app/src/com/android/ddms/DropdownSelectionListener.java +++ b/ddms/app/src/com/android/ddms/DropdownSelectionListener.java @@ -73,7 +73,7 @@ public class DropdownSelectionListener extends SelectionAdapter { mMenu.setVisible(true); } else { // button clicked - Log.i("ddms", mDropdown.getText() + " Pressed"); + Log.d("ddms", mDropdown.getText() + " Pressed"); } } } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java index 5f0f2716f..db88f6704 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java @@ -613,7 +613,7 @@ final class AdbHelper { } else if (count == 0) { // TODO: need more accurate timeout? if (timeout != 0 && numWaits * WAIT_TIME > timeout) { - Log.i("ddms", "read: timeout"); + Log.d("ddms", "read: timeout"); throw new IOException("timeout"); } // non-blocking spin @@ -670,7 +670,7 @@ final class AdbHelper { } else if (count == 0) { // TODO: need more accurate timeout? if (timeout != 0 && numWaits * WAIT_TIME > timeout) { - Log.i("ddms", "write: timeout"); + Log.d("ddms", "write: timeout"); throw new IOException("timeout"); } // non-blocking spin diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java index 1c47b8526..d51c6a02c 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java @@ -541,7 +541,7 @@ public class Client { Debugger dbg = mDebugger; if (dbg == null) { - Log.i("ddms", "Discarding packet"); + Log.d("ddms", "Discarding packet"); packet.consume(); } else { dbg.sendAndConsume(packet); @@ -614,7 +614,7 @@ public class Client { //Log.v("ddms", "findHand: " + result); switch (result) { case JdwpPacket.HANDSHAKE_GOOD: - Log.i("ddms", + Log.d("ddms", "Good handshake from client, sending HELO to " + mClientData.getPid()); JdwpPacket.consumeHandshake(mReadBuffer); mConnState = ST_NEED_DDM_PKT; @@ -622,7 +622,7 @@ public class Client { // see if we have another packet in the buffer return getJdwpPacket(); case JdwpPacket.HANDSHAKE_BAD: - Log.i("ddms", "Bad handshake from client"); + Log.d("ddms", "Bad handshake from client"); if (MonitorThread.getInstance().getRetryOnBadHandshake()) { // we should drop the client, but also attempt to reopen it. // This is done by the DeviceMonitor. @@ -635,7 +635,7 @@ public class Client { } break; case JdwpPacket.HANDSHAKE_NOTYET: - Log.i("ddms", "No handshake from client yet."); + Log.d("ddms", "No handshake from client yet."); break; default: Log.e("ddms", "Unknown packet while waiting for client handshake"); @@ -713,7 +713,7 @@ public class Client { */ void packetFailed(JdwpPacket reply) { if (mConnState == ST_NEED_DDM_PKT) { - Log.i("ddms", "Marking " + this + " as non-DDM client"); + Log.d("ddms", "Marking " + this + " as non-DDM client"); mConnState = ST_NOT_DDM; } else if (mConnState != ST_NOT_DDM) { Log.w("ddms", "WEIRD: got JDWP failure packet on DDM req"); @@ -751,7 +751,7 @@ public class Client { * @param notify Whether or not to notify the listeners of a change. */ void close(boolean notify) { - Log.i("ddms", "Closing " + this.toString()); + Log.d("ddms", "Closing " + this.toString()); mOutstandingReqs.clear(); diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java index f30509a43..39ec4b5b3 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java @@ -78,7 +78,7 @@ class Debugger { mPreDataBuffer = ByteBuffer.allocate(PRE_DATA_BUF_SIZE); mConnState = ST_NOT_CONNECTED; - Log.i("ddms", "Created: " + this.toString()); + Log.d("ddms", "Created: " + this.toString()); } /** @@ -137,7 +137,7 @@ class Debugger { if (listenChan != null) { SocketChannel newChan; - + newChan = listenChan.accept(); if (mChannel != null) { Log.w("ddms", "debugger already talking to " + mClient @@ -150,7 +150,7 @@ class Debugger { mConnState = ST_AWAIT_SHAKE; return mChannel; } - + return null; } @@ -243,7 +243,7 @@ class Debugger { //Log.v("ddms", "findHand: " + result); switch (result) { case JdwpPacket.HANDSHAKE_GOOD: - Log.i("ddms", "Good handshake from debugger"); + Log.d("ddms", "Good handshake from debugger"); JdwpPacket.consumeHandshake(mReadBuffer); sendHandshake(); mConnState = ST_READY; @@ -256,7 +256,7 @@ class Debugger { return getJdwpPacket(); case JdwpPacket.HANDSHAKE_BAD: // not a debugger, throw an exception so we drop the line - Log.i("ddms", "Bad handshake from debugger"); + Log.d("ddms", "Bad handshake from debugger"); throw new IOException("bad handshake"); case JdwpPacket.HANDSHAKE_NOTYET: break; @@ -272,7 +272,7 @@ class Debugger { } else { Log.e("ddms", "Receiving data in state = " + mConnState); } - + return null; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java index e9294314b..e23d8177a 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java @@ -438,14 +438,14 @@ final class Device implements IDevice { String packageFileName = getFileName(localFilePath); String remoteFilePath = String.format("/data/local/tmp/%1$s", packageFileName); //$NON-NLS-1$ - Log.i(packageFileName, String.format("Uploading %1$s onto device '%2$s'", + Log.d(packageFileName, String.format("Uploading %1$s onto device '%2$s'", packageFileName, getSerialNumber())); SyncService sync = getSyncService(); if (sync != null) { String message = String.format("Uploading file onto device '%1$s'", getSerialNumber()); - Log.i(LOG_TAG, message); + Log.d(LOG_TAG, message); SyncResult result = sync.pushFile(localFilePath, remoteFilePath, SyncService.getNullProgressMonitor()); diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java index 99bd4d04b..c821dfcdc 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java @@ -77,7 +77,7 @@ final class HandleAppName extends ChunkHandler { appNameLen = data.getInt(); appName = getString(data, appNameLen); - Log.i("ddm-appname", "APNM: app='" + appName + "'"); + Log.d("ddm-appname", "APNM: app='" + appName + "'"); ClientData cd = client.getClientData(); synchronized (cd) { diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java index f186899b8..19f367b0e 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java @@ -267,7 +267,7 @@ final class HandleHeap extends ChunkHandler { if (result == 0) { handler.onSuccess(filename, client); - Log.i("ddm-heap", "Heap dump request has finished"); + Log.d("ddm-heap", "Heap dump request has finished"); } else { handler.onFailure(client); Log.w("ddm-heap", "Heap dump request failed (check device log)"); diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java index 078965565..5fe1ed89d 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java @@ -125,7 +125,7 @@ final class HandleProfiling extends ChunkHandler { result = data.get(); if (result == 0) { - Log.i("ddm-prof", "Method profiling has finished"); + Log.d("ddm-prof", "Method profiling has finished"); } else { Log.w("ddm-prof", "Method profiling has failed (check device log)"); } @@ -157,9 +157,9 @@ final class HandleProfiling extends ChunkHandler { result = data.get(); if (result == 0) { - Log.i("ddm-prof", "Method profiling is not running"); + Log.d("ddm-prof", "Method profiling is not running"); } else { - Log.i("ddm-prof", "Method profiling is running"); + Log.d("ddm-prof", "Method profiling is running"); } } } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java index 572eed2ff..8430c95d6 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java @@ -178,13 +178,13 @@ final class HandleThread extends ChunkHandler { if (threadInfo != null) threadInfo.updateThread(status, tid, utime, stime, isDaemon); else - Log.i("ddms", "Thread with id=" + threadId + " not found"); + Log.d("ddms", "Thread with id=" + threadId + " not found"); // slurp up any extra for (int slurp = extraPerEntry; slurp > 0; slurp--) data.get(); } - + client.update(Client.CHANGE_THREAD_DATA); } @@ -207,7 +207,7 @@ final class HandleThread extends ChunkHandler { threadInfo.setThreadName(name); client.update(Client.CHANGE_THREAD_DATA); } else { - Log.i("ddms", "Thread with id=" + threadId + " not found"); + Log.d("ddms", "Thread with id=" + threadId + " not found"); } } @@ -291,7 +291,7 @@ final class HandleThread extends ChunkHandler { throws IOException { if (false) { - Log.i("ddm-thread", "would send STKL " + threadId); + Log.d("ddm-thread", "would send STKL " + threadId); return; } @@ -326,7 +326,7 @@ final class HandleThread extends ChunkHandler { try { sendTHST(client); } catch (IOException ioe) { - Log.i("ddms", "Unable to request thread updates from " + Log.d("ddms", "Unable to request thread updates from " + client + ": " + ioe.getMessage()); } finally { mThreadStatusReqRunning = false; @@ -335,7 +335,7 @@ final class HandleThread extends ChunkHandler { }.start(); } } - + static void requestThreadStackCallRefresh(final Client client, final int threadId) { if (client.isDdmAware() && client.isThreadUpdateEnabled()) { if (mThreadStackTraceReqRunning ) { @@ -350,7 +350,7 @@ final class HandleThread extends ChunkHandler { try { sendSTKL(client, threadId); } catch (IOException ioe) { - Log.i("ddms", "Unable to request thread stack call updates from " + Log.d("ddms", "Unable to request thread stack call updates from " + client + ": " + ioe.getMessage()); } finally { mThreadStackTraceReqRunning = false; @@ -358,7 +358,7 @@ final class HandleThread extends ChunkHandler { } }.start(); } - + } /* diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java index d27e63645..480b525bc 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java @@ -75,7 +75,7 @@ final class HandleWait extends ChunkHandler { reason = data.get(); - Log.i("ddm-wait", "WAIT: reason=" + reason); + Log.d("ddm-wait", "WAIT: reason=" + reason); ClientData cd = client.getClientData(); diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java b/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java index 3089c2eee..a51494541 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java @@ -499,7 +499,7 @@ final class MonitorThread extends Thread { throw re; } } else { - Log.i("ddms", "ignoring duplicate debugger"); + Log.w("ddms", "ignoring duplicate debugger"); // new connection already closed } } @@ -542,19 +542,19 @@ final class MonitorThread extends Thread { * this won't be necessary, and we can just send a "debugger * disconnected" message. */ - Log.i("ddms", "Closing connection to debugger " + dbg); + Log.d("ddms", "Closing connection to debugger " + dbg); dbg.closeData(); Client client = dbg.getClient(); if (client.isDdmAware()) { // TODO: soft-disconnect DDM-aware clients - Log.i("ddms", " (recycling client connection as well)"); + Log.d("ddms", " (recycling client connection as well)"); // we should drop the client, but also attempt to reopen it. // This is done by the DeviceMonitor. client.getDeviceImpl().getMonitor().addClientToDropAndReopen(client, IDebugPortProvider.NO_STATIC_PORT); } else { - Log.i("ddms", " (recycling client connection as well)"); + Log.d("ddms", " (recycling client connection as well)"); // we should drop the client, but also attempt to reopen it. // This is done by the DeviceMonitor. client.getDeviceImpl().getMonitor().addClientToDropAndReopen(client, @@ -747,7 +747,7 @@ final class MonitorThread extends Thread { Debugger dbg = mSelectedClient.getDebugger(); if (dbg != null) { - Log.i("ddms", "Accepting connection on 'debug selected' port"); + Log.d("ddms", "Accepting connection on 'debug selected' port"); try { acceptNewDebugger(dbg, acceptChan); } catch (IOException ioe) { diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java index b9bb10c08..b0200fa01 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java @@ -229,7 +229,7 @@ public class ScreenShotDialog extends Dialog { if (fileName != null) { DdmUiPreferences.getStore().setValue("lastImageSaveDir", dlg.getFilterPath()); - Log.i("ddms", "Saving image to " + fileName); + Log.d("ddms", "Saving image to " + fileName); ImageData imageData = mImageLabel.getImage().getImageData(); try { diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/WritePng.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/WritePng.java index f65dafe97..804b41682 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/WritePng.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/WritePng.java @@ -68,7 +68,7 @@ public class WritePng { int height = imageData.height; byte[] out24; - Log.i("ddms-png", "Convert to 24bit from " + imageData.depth); + Log.d("ddms-png", "Convert to 24bit from " + imageData.depth); if (imageData.depth == 24 || imageData.depth == 32) { out24 = convertTo24ForPng(imageData.data, width, height,