summaryrefslogtreecommitdiff
path: root/uiautomator
diff options
context:
space:
mode:
authorThanh Le <thanhle@google.com>2013-01-22 14:17:46 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-01-22 14:17:46 -0800
commita1c9eab767cbfad143c024d171cf9cff30acac42 (patch)
tree8aa62620ced9498d2c31b2106f71303daa9576f8 /uiautomator
parent74776ceaef772c152bbc012842b887ee540f6e46 (diff)
parentb6bddc2aa5bb2cf093140e3b1dec6e387ecbc770 (diff)
downloadtesting-a1c9eab767cbfad143c024d171cf9cff30acac42.tar.gz
am b6bddc2a: am 6ae71e50: am 506016a8: Merge "Make debug logging configurable via the logging setprop properties." into jb-mr1.1-dev
* commit 'b6bddc2aa5bb2cf093140e3b1dec6e387ecbc770': Make debug logging configurable via the logging setprop properties.
Diffstat (limited to 'uiautomator')
-rw-r--r--uiautomator/library/src/com/android/uiautomator/core/InteractionController.java2
-rw-r--r--uiautomator/library/src/com/android/uiautomator/core/QueryController.java34
2 files changed, 18 insertions, 18 deletions
diff --git a/uiautomator/library/src/com/android/uiautomator/core/InteractionController.java b/uiautomator/library/src/com/android/uiautomator/core/InteractionController.java
index f4c6b11..93a162e 100644
--- a/uiautomator/library/src/com/android/uiautomator/core/InteractionController.java
+++ b/uiautomator/library/src/com/android/uiautomator/core/InteractionController.java
@@ -58,7 +58,7 @@ class InteractionController {
private static final String LOG_TAG = InteractionController.class.getSimpleName();
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = Log.isLoggable(LOG_TAG, Log.DEBUG);
private static final long DEFAULT_SCROLL_EVENT_TIMEOUT_MILLIS = 500;
diff --git a/uiautomator/library/src/com/android/uiautomator/core/QueryController.java b/uiautomator/library/src/com/android/uiautomator/core/QueryController.java
index f14b017..0af603a 100644
--- a/uiautomator/library/src/com/android/uiautomator/core/QueryController.java
+++ b/uiautomator/library/src/com/android/uiautomator/core/QueryController.java
@@ -30,7 +30,8 @@ class QueryController {
private static final String LOG_TAG = QueryController.class.getSimpleName();
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = Log.isLoggable(LOG_TAG, Log.DEBUG);
+ private static final boolean VERBOSE = Log.isLoggable(LOG_TAG, Log.VERBOSE);
private final UiAutomatorBridge mUiAutomatorBridge;
@@ -71,8 +72,8 @@ class QueryController {
if (event.getText() != null && event.getText().size() > 0)
if(event.getText().get(0) != null)
mLastTraversedText = event.getText().get(0).toString();
- if(DEBUG)
- Log.i(LOG_TAG, "Last text selection reported: " +
+ if (DEBUG)
+ Log.d(LOG_TAG, "Last text selection reported: " +
mLastTraversedText);
break;
}
@@ -142,8 +143,8 @@ class QueryController {
mUiAutomatorBridge.waitForIdle();
initializeNewSearch();
- if(DEBUG)
- Log.i(LOG_TAG, "Searching: " + selector);
+ if (DEBUG)
+ Log.d(LOG_TAG, "Searching: " + selector);
synchronized (mLock) {
AccessibilityNodeInfo rootNode = getRootNode();
@@ -229,8 +230,8 @@ class QueryController {
fromNode = translateReqularSelector(selector, fromNode);
if(fromNode == null) {
- if(DEBUG)
- Log.i(LOG_TAG, "Container selector not found: " + selector.dumpToString(false));
+ if (DEBUG)
+ Log.d(LOG_TAG, "Container selector not found: " + selector.dumpToString(false));
return null;
}
@@ -244,8 +245,8 @@ class QueryController {
return null;
} else {
if(fromNode == null) {
- if(DEBUG)
- Log.i(LOG_TAG, "Pattern selector not found: " +
+ if (DEBUG)
+ Log.d(LOG_TAG, "Pattern selector not found: " +
selector.dumpToString(false));
return null;
}
@@ -260,8 +261,8 @@ class QueryController {
}
if(fromNode == null) {
- if(DEBUG)
- Log.i(LOG_TAG, "Object Not Found for selector " + selector);
+ if (DEBUG)
+ Log.d(LOG_TAG, "Object Not Found for selector " + selector);
return null;
}
Log.i(LOG_TAG, String.format("Matched selector: %s <<==>> [%s]", selector, fromNode));
@@ -334,9 +335,8 @@ class QueryController {
continue;
}
if (!childNode.isVisibleToUser()) {
- // TODO: need to remove this or move it under if (DEBUG)
- if(DEBUG)
- Log.d(LOG_TAG,
+ if (VERBOSE)
+ Log.v(LOG_TAG,
String.format("Skipping invisible child: %s", childNode.toString()));
continue;
}
@@ -411,7 +411,7 @@ class QueryController {
String.format("%s", subSelector.dumpToString(false))));
return fromNode;
} else {
- if(DEBUG)
+ if (DEBUG)
Log.d(LOG_TAG, formatLog(
String.format("%s", subSelector.dumpToString(false))));
mPatternCounter++; //count the pattern matched
@@ -426,7 +426,7 @@ class QueryController {
mLogIndent = mLogParentIndent;
}
} else {
- if(DEBUG)
+ if (DEBUG)
Log.d(LOG_TAG, formatLog(
String.format("%s", subSelector.dumpToString(false))));
@@ -465,7 +465,7 @@ class QueryController {
continue;
}
if (!childNode.isVisibleToUser()) {
- if(DEBUG)
+ if (DEBUG)
Log.d(LOG_TAG,
String.format("Skipping invisible child: %s", childNode.toString()));
continue;