Skip to content

Commit

Permalink
Limit stdout tracelog to actual stdout
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 committed Jun 26, 2021
1 parent 622f1e7 commit c7ec21a
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 c7ec21a

Please sign in to comment.