Skip to content

Commit 19a49f0

Browse files
HuijingHeijlebon
authored andcommitted
Could save console logs when running with devshell
Fixes: #3613
1 parent 5824720 commit 19a49f0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

mantle/cmd/kola/devshell.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,19 @@ func runDevShellSSH(ctx context.Context, builder *platform.QemuBuilder, conf *co
114114
if err != nil {
115115
return err
116116
}
117-
serialLog, err := os.CreateTemp(tmpd, "cosa-run-serial")
118-
if err != nil {
119-
return err
117+
118+
// Save console logs
119+
var serialLog *os.File
120+
if builder.ConsoleFile != "" {
121+
serialLog, err = os.Create(builder.ConsoleFile)
122+
if err != nil {
123+
return err
124+
}
125+
} else {
126+
serialLog, err = os.CreateTemp(tmpd, "cosa-run-serial")
127+
if err != nil {
128+
return err
129+
}
120130
}
121131

122132
builder.InheritConsole = false

0 commit comments

Comments
 (0)