mirror of
https://github.com/appium/appium.git
synced 2026-02-09 11:18:51 -06:00
Clean up debug logging
This commit is contained in:
committed by
Payman Delshad
parent
113fe5ce10
commit
d70f8ac01d
@@ -15,14 +15,13 @@ public class TouchDown extends TouchEvent {
|
||||
|
||||
@Override
|
||||
protected boolean executeTouchEvent() throws UiObjectNotFoundException {
|
||||
Logger.debug("Performing touchDown using element? " + isElement + " x: "
|
||||
+ clickX + ", y: " + clickY);
|
||||
printEventDebugLine("TouchDown");
|
||||
try {
|
||||
final Object controller = getController();
|
||||
final Method touchDown = getMethod("touchDown", controller);
|
||||
return (Boolean) touchDown.invoke(controller, clickX, clickY);
|
||||
} catch (final Exception e) {
|
||||
Logger.debug("Problem invoking correct touchDown: " + e);
|
||||
Logger.debug("Problem invoking touchDown: " + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,4 +136,14 @@ public abstract class TouchEvent extends CommandHandler {
|
||||
method.setAccessible(true);
|
||||
return method;
|
||||
}
|
||||
|
||||
protected void printEventDebugLine(final String methodName,
|
||||
final Integer... duration) {
|
||||
String extra = "";
|
||||
if (duration.length > 0) {
|
||||
extra = ", duration: " + duration[0];
|
||||
}
|
||||
Logger.debug("Performing " + methodName + " using element? " + isElement
|
||||
+ " x: " + clickX + ", y: " + clickY + extra);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,7 @@ public class TouchLongClick extends TouchEvent {
|
||||
duration = Integer.parseInt(paramDuration.toString());
|
||||
}
|
||||
|
||||
Logger.debug("Performing longClick using element? " + isElement + " x: "
|
||||
+ clickX + ", y: " + clickY + " with duration: " + duration);
|
||||
printEventDebugLine("TouchLongClick", duration);
|
||||
if (correctLongClick(clickX, clickY, duration)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,14 +15,13 @@ public class TouchMove extends TouchEvent {
|
||||
|
||||
@Override
|
||||
protected boolean executeTouchEvent() throws UiObjectNotFoundException {
|
||||
Logger.debug("Performing touchMove using element? " + isElement + " x: "
|
||||
+ clickX + ", y: " + clickY);
|
||||
printEventDebugLine("TouchMove");
|
||||
try {
|
||||
final Object controller = getController();
|
||||
final Method touchMove = getMethod("touchMove", controller);
|
||||
return (Boolean) touchMove.invoke(controller, clickX, clickY);
|
||||
} catch (final Exception e) {
|
||||
Logger.debug("Problem invoking correct touchMove: " + e);
|
||||
Logger.debug("Problem invoking touchMove: " + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,13 @@ public class TouchUp extends TouchEvent {
|
||||
|
||||
@Override
|
||||
protected boolean executeTouchEvent() throws UiObjectNotFoundException {
|
||||
Logger.debug("Performing touchUp using element? " + isElement + " x: "
|
||||
+ clickX + ", y: " + clickY);
|
||||
printEventDebugLine("TouchUp");
|
||||
try {
|
||||
final Object controller = getController();
|
||||
final Method touchUp = getMethod("touchUp", controller);
|
||||
return (Boolean) touchUp.invoke(controller, clickX, clickY);
|
||||
} catch (final Exception e) {
|
||||
Logger.debug("Problem invoking correct touchUp: " + e);
|
||||
Logger.debug("Problem invoking touchUp: " + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user