Skip to content

Commit fbb1bdb

Browse files
committed
Add better logging
1 parent 012519b commit fbb1bdb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

agent/agent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ func (a *agent) runStartupScript(ctx context.Context, script string) error {
375375
return nil
376376
}
377377

378+
a.logger.Info(ctx, "running startup script", slog.F("script", script))
378379
writer, err := os.OpenFile(filepath.Join(os.TempDir(), "coder-startup-script.log"), os.O_CREATE|os.O_RDWR, 0o600)
379380
if err != nil {
380381
return xerrors.Errorf("open startup script log file: %w", err)

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ func TestAgent(t *testing.T) {
363363
tempPath := filepath.Join(t.TempDir(), "content.txt")
364364
content := "somethingnice"
365365
setupAgent(t, codersdk.WorkspaceAgentMetadata{
366-
StartupScript: fmt.Sprintf("echo %s > %s", content, tempPath),
366+
StartupScript: fmt.Sprintf("echo %s> %s", content, tempPath),
367367
}, 0)
368368

369369
var gotContent string

0 commit comments

Comments
 (0)