From 419febd635936a5a5a2aade1bcf37390ae13f72a Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Fri, 23 Jun 2023 23:40:12 +0800 Subject: [PATCH] feat: log uixt action elapsed in seconds --- hrp/pkg/uixt/action.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hrp/pkg/uixt/action.go b/hrp/pkg/uixt/action.go index b47ba5a1..eba5a990 100644 --- a/hrp/pkg/uixt/action.go +++ b/hrp/pkg/uixt/action.go @@ -377,7 +377,19 @@ func (dExt *DriverExt) GenAbsScope(x1, y1, x2, y2 float64) AbsScope { } func (dExt *DriverExt) DoAction(action MobileAction) error { - log.Info().Str("method", string(action.Method)).Interface("params", action.Params).Msg("start UI action") + log.Debug(). + Str("method", string(action.Method)). + Interface("params", action.Params). + Msg("uixt action start") + actionStartTime := time.Now() + + defer func() { + log.Debug(). + Str("method", string(action.Method)). + Interface("params", action.Params). + Float64("elapsed(s)", time.Since(actionStartTime).Seconds()). + Msg("uixt action end") + }() switch action.Method { case ACTION_AppInstall: