Skip to content

Commit

Permalink
Limit stdout tracelog to actual stdout (go-gitea#16258)
Browse files Browse the repository at this point in the history
Related go-gitea#16243

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored and AbdulrhmnGhanem committed Aug 10, 2021
1 parent a52bc57 commit baf6c3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/git/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ func (c *Command) RunInDirTimeoutEnv(env []string, timeout time.Duration, dir st
return nil, ConcatenateError(err, stderr.String())
}
if stdout.Len() > 0 && log.IsTrace() {
log.Trace("Stdout:\n %s", stdout.Bytes()[:1024])
tracelen := stdout.Len()
if tracelen > 1024 {
tracelen = 1024
}
log.Trace("Stdout:\n %s", stdout.Bytes()[:tracelen])
}
return stdout.Bytes(), nil
}
Expand Down

0 comments on commit baf6c3c

Please sign in to comment.