Skip to content

Commit

Permalink
Fix in logs to file when debug=true
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrithagoramane committed Sep 12, 2024
1 parent 1a7a8f2 commit 1015a05
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions venv.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,19 @@ func (c VenvCommand) Run() VenvCommandRunOutput {

for stream, out := range output {
go func(s io.ReadCloser, o *string) {
var bufstdout bytes.Buffer
var buff bytes.Buffer

scanner := bufio.NewScanner(s)
scanner.Split(bufio.ScanLines)

for scanner.Scan() {
m := scanner.Text()
fmt.Println(m)
bufstdout.WriteString(m)
bufstdout.WriteString("\n")
buff.WriteString(m)
buff.WriteString("\n")
}
*o = fmt.Sprint(bufstdout.String())
*o = fmt.Sprint(buff.String())

}(stream, out)
}

Expand Down

0 comments on commit 1015a05

Please sign in to comment.