change: log time duration for ui marker

This commit is contained in:
lilong.129
2025-05-05 16:35:37 +08:00
parent cfc71819d2
commit e5ececa776
2 changed files with 7 additions and 2 deletions

View File

@@ -1 +1 @@
v5.0.0-beta-2505051631
v5.0.0-beta-2505051635

View File

@@ -13,6 +13,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
@@ -303,6 +304,7 @@ func MarkUIOperation(driver IDriver, actionType ActionMethod, actionCoordinates
if actionType == "" || len(actionCoordinates) == 0 {
return nil
}
start := time.Now()
// get screenshot
compressedBufSource, err := driver.ScreenShot()
@@ -340,13 +342,16 @@ func MarkUIOperation(driver IDriver, actionType ActionMethod, actionCoordinates
err = SaveImageWithArrowMarker(compressedBufSource, from, to, imagePath)
}
if err != nil {
log.Error().Err(err).Msg("mark UI operation failed")
log.Error().Err(err).
Int64("duration(ms)", time.Since(start).Milliseconds()).
Msg("mark UI operation failed")
return err
}
if imagePath != "" {
log.Info().Str("operation", string(actionType)).
Str("imagePath", imagePath).
Int64("duration(ms)", time.Since(start).Milliseconds()).
Msg("mark UI operation success")
}