feat: log adb driver request and response

This commit is contained in:
lilong.129
2024-12-08 11:17:19 +08:00
parent 5546181426
commit 3cc4c47dfa
4 changed files with 85 additions and 48 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
@@ -65,10 +66,11 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S
var lastErr error
// get screenshot info with retry
for i := 0; i < actionOptions.MaxRetryTimes; i++ {
for i := 0; i <= actionOptions.MaxRetryTimes; i++ {
bufSource, imagePath, err = dExt.GetScreenShot(fileName)
if err != nil {
lastErr = err
time.Sleep(time.Second * 1)
continue
}