Skip to content

Commit 2ecdeeb

Browse files
authored
Clean up logs (#111)
## Overview Removes xdotool and playwright excess logs <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Logging cleanup** > > - Remove `log.Info` statements that printed xdotool args in `TypeText` and `PressKey` (keydown/keyup/tap phases) > - Simplify Playwright error logging to exclude raw process output and only log the error; similarly reduce logs on JSON parse failures > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5980e75. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 8695e35 commit 2ecdeeb

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

server/cmd/api/api/computer.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ func (s *ApiService) TypeText(ctx context.Context, request oapi.TypeTextRequestO
350350
// Use "--" to terminate options and pass raw text
351351
args = append(args, "--", body.Text)
352352

353-
log.Info("executing xdotool", "args", args)
354-
355353
output, err := defaultXdoTool.Run(ctx, args...)
356354
if err != nil {
357355
log.Error("xdotool command failed", "err", err, "output", string(output))
@@ -465,7 +463,6 @@ func (s *ApiService) PressKey(ctx context.Context, request oapi.PressKeyRequestO
465463
argsDown = append(argsDown, "keydown", key)
466464
}
467465

468-
log.Info("executing xdotool (keydown phase)", "args", argsDown)
469466
if output, err := defaultXdoTool.Run(ctx, argsDown...); err != nil {
470467
log.Error("xdotool keydown failed", "err", err, "output", string(output))
471468
// Best-effort release any keys that may be down (primary and modifiers)
@@ -497,7 +494,6 @@ func (s *ApiService) PressKey(ctx context.Context, request oapi.PressKeyRequestO
497494
}
498495
}
499496

500-
log.Info("executing xdotool (keyup phase)", "args", argsUp)
501497
if output, err := defaultXdoTool.Run(ctx, argsUp...); err != nil {
502498
log.Error("xdotool keyup failed", "err", err, "output", string(output))
503499
return oapi.PressKey500JSONResponse{InternalErrorJSONResponse: oapi.InternalErrorJSONResponse{
@@ -524,7 +520,6 @@ func (s *ApiService) PressKey(ctx context.Context, request oapi.PressKeyRequestO
524520
}
525521
}
526522

527-
log.Info("executing xdotool", "args", args)
528523
output, err := defaultXdoTool.Run(ctx, args...)
529524
if err != nil {
530525
log.Error("xdotool command failed", "err", err, "output", string(output))

server/cmd/api/api/playwright.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (s *ApiService) ExecutePlaywrightCode(ctx context.Context, request oapi.Exe
8080
}, nil
8181
}
8282

83-
log.Error("playwright execution failed", "error", err, "output", string(output))
83+
log.Error("playwright execution failed", "error", err)
8484

8585
// Try to parse the error output as JSON
8686
var result struct {
@@ -117,7 +117,7 @@ func (s *ApiService) ExecutePlaywrightCode(ctx context.Context, request oapi.Exe
117117
Result interface{} `json:"result,omitempty"`
118118
}
119119
if err := json.Unmarshal(output, &result); err != nil {
120-
log.Error("failed to parse playwright output", "error", err, "output", string(output))
120+
log.Error("failed to parse playwright output", "error", err)
121121
success := false
122122
errorMsg := fmt.Sprintf("failed to parse output: %v", err)
123123
stdout := string(output)

0 commit comments

Comments
 (0)