添加日志

This commit is contained in:
wangzhengzhen
2025-01-07 10:12:11 +08:00
parent 07043e8d76
commit b1f02229a4
4 changed files with 43 additions and 10 deletions

View File

@@ -1,5 +1,8 @@
import adb
import random
import common
log = common.get_logger("devices", "debug")
class _Action:
def __init__(self, id, scr_w, scr_h):
@@ -37,6 +40,7 @@ class _Action:
x2 = x1 + int(random.uniform(-10, 10))
y2 = y1 - dist + int(random.uniform(-10, 10))
time = speed - int(random.uniform(-10, 10))
log.debug("x1: {} , y1: {} , x2: {} , y2: {} , time: {}".format(x1, y1, x2, y2, time))
self.operator.swipe(x1, y1, x2, y2, time)
# 下滑
@@ -46,6 +50,7 @@ class _Action:
x2 = x1 + int(random.uniform(-10, 10))
y2 = y1 + dist + int(random.uniform(-10, 10))
time = speed + int(random.uniform(-10, 10))
log.debug("x1: {} , y1: {} , x2: {} , y2: {} , time: {}".format(x1, y1, x2, y2, time))
self.operator.swipe(x1, y1, x2, y2, time)
# 左滑
@@ -55,6 +60,7 @@ class _Action:
x2 = x1 - dist + int(random.uniform(-10, 10))
y2 = y1 + int(random.uniform(-10, 10))
time = speed + int(random.uniform(-10, 10))
log.debug("x1: {} , y1: {} , x2: {} , y2: {} , time: {}".format(x1, y1, x2, y2, time))
self.operator.swipe(x1, y1, x2, y2, time)
# 右滑
@@ -64,6 +70,7 @@ class _Action:
x2 = x1 + dist + int(random.uniform(-10, 10))
y2 = y1 + int(random.uniform(-10, 10))
time = speed + int(random.uniform(-10, 10))
log.debug("x1: {} , y1: {} , x2: {} , y2: {} , time: {}".format(x1, y1, x2, y2, time))
self.operator.swipe(x1, y1, x2, y2, time)
# 点击