aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2010-07-27 09:11:15 -0400
committerRaphael Moll <ralf@android.com>2010-07-27 09:11:15 -0400
commit2e43b58d4e4bf4a2dfbf2a605c8c309a0cfd01b6 (patch)
treef6e605438274aeaf416bd307f7390b8f90ee4b0b
parentf92347747179fbb30b9b772fd4f5c59124db1548 (diff)
downloadsdk-2e43b58d4e4bf4a2dfbf2a605c8c309a0cfd01b6.zip
sdk-2e43b58d4e4bf4a2dfbf2a605c8c309a0cfd01b6.tar.gz
sdk-2e43b58d4e4bf4a2dfbf2a605c8c309a0cfd01b6.tar.bz2
ADT GLE2: Remove (or disable) debug printfs.
Change-Id: I3d8a0f6b4731ee78af8da33c1749423ca7b13254
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/gscripts/BaseView.groovy2
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasDropListener.java16
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java4
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java10
4 files changed, 18 insertions, 14 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/gscripts/BaseView.groovy b/eclipse/plugins/com.android.ide.eclipse.adt/gscripts/BaseView.groovy
index fa81ec8..714c6b7 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/gscripts/BaseView.groovy
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/gscripts/BaseView.groovy
@@ -42,7 +42,7 @@ public class BaseView implements IViewRule {
// Derived classes should do so if they can handle some subclasses.
// For debugging and as an example of how to use the injected _rules_engine property.
- _rules_engine.debugPrintf("Initialize() of %s", _rules_engine.getFqcn());
+ // _rules_engine.debugPrintf("Initialize() of %s", _rules_engine.getFqcn());
// If onInitialize returns false, it means it can't handle the given FQCN and
// will be unloaded.
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasDropListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasDropListener.java
index e3a433c..8c4e46f 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasDropListener.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasDropListener.java
@@ -36,6 +36,8 @@ import java.util.Arrays;
*/
/* package */ class CanvasDropListener implements DropTargetListener {
+ private static final boolean DEBUG = false;
+
private final LayoutCanvas mCanvas;
/**
@@ -101,7 +103,7 @@ import java.util.Arrays;
* {@inheritDoc}
*/
public void dragEnter(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drag enter", event);
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drag enter", event);
// Make sure we don't have any residual data from an earlier operation.
clearDropInfo();
@@ -148,7 +150,7 @@ import java.util.Arrays;
* {@inheritDoc}
*/
public void dragOperationChanged(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drag changed", event);
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drag changed", event);
checkDataType(event);
recomputeDragType(event);
@@ -179,7 +181,7 @@ import java.util.Arrays;
* {@inheritDoc}
*/
public void dragLeave(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drag leave");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drag leave");
// dragLeave is unfortunately called right before data is about to be dropped
// (between the last dropMove and the next dropAccept). That means we can't just
@@ -207,7 +209,7 @@ import java.util.Arrays;
* {@inheritDoc}
*/
public void dropAccept(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drop accept");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drop accept");
checkDataType(event);
@@ -233,7 +235,7 @@ import java.util.Arrays;
* {@inheritDoc}
*/
public void drop(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "dropped");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "dropped");
SimpleElement[] elements = null;
@@ -246,7 +248,7 @@ import java.util.Arrays;
}
if (elements == null || elements.length < 1) {
- AdtPlugin.printErrorToConsole("DEBUG", "drop missing drop data");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drop missing drop data");
return;
}
@@ -260,7 +262,7 @@ import java.util.Arrays;
// Attempt to create a root node accordingly.
createDocumentRoot(elements);
} else {
- AdtPlugin.printErrorToConsole("DEBUG", "dropped on null targetNode");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "dropped on null targetNode");
}
return;
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
index c724207..0e56bba 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
@@ -140,6 +140,8 @@ import java.util.Set;
*/
class LayoutCanvas extends Canvas implements ISelectionProvider {
+ private final static boolean DEBUG = false;
+
/* package */ static final String PREFIX_CANVAS_ACTION = "canvas_action_";
/** The layout editor that uses this layout canvas. */
@@ -2178,6 +2180,6 @@ class LayoutCanvas extends Canvas implements ISelectionProvider {
}
private void debugPrintf(String message, Object... params) {
- AdtPlugin.printToConsole("Canvas", String.format(message, params));
+ if (DEBUG) AdtPlugin.printToConsole("Canvas", String.format(message, params));
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java
index 72be438..6d9c98e 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java
@@ -199,7 +199,7 @@ public class NodeProxy implements INode {
// Find the descriptor for this FQCN
ViewElementDescriptor vd = getFqcnViewDescritor(viewFqcn);
if (vd == null) {
- debugPrintf("Can't create a new %s element", viewFqcn);
+ warnPrintf("Can't create a new %s element", viewFqcn);
return null;
}
@@ -218,7 +218,7 @@ public class NodeProxy implements INode {
// Panic ensues.
// The best bet is to abort now. The edit wrapper will release the edit and the
// XML/UI should get reloaded properly (with a likely invalid XML.)
- debugPrintf("Failed to create a new %s element", viewFqcn);
+ warnPrintf("Failed to create a new %s element", viewFqcn);
throw new RuntimeException("XML node creation failed."); //$NON-NLS-1$
}
@@ -231,7 +231,7 @@ public class NodeProxy implements INode {
// Find the descriptor for this FQCN
ViewElementDescriptor vd = getFqcnViewDescritor(viewFqcn);
if (vd == null) {
- debugPrintf("Can't create a new %s element", viewFqcn);
+ warnPrintf("Can't create a new %s element", viewFqcn);
return null;
}
@@ -256,7 +256,7 @@ public class NodeProxy implements INode {
// Panic ensues.
// The best bet is to abort now. The edit wrapper will release the edit and the
// XML/UI should get reloaded properly (with a likely invalid XML.)
- debugPrintf("Failed to create a new %s element", viewFqcn);
+ warnPrintf("Failed to create a new %s element", viewFqcn);
throw new RuntimeException("XML node creation failed."); //$NON-NLS-1$
}
@@ -359,7 +359,7 @@ public class NodeProxy implements INode {
return null;
}
- private void debugPrintf(String msg, Object...params) {
+ private void warnPrintf(String msg, Object...params) {
AdtPlugin.printToConsole(
mNode == null ? "Groovy" : mNode.getDescriptor().getXmlLocalName() + ".groovy",
String.format(msg, params)