mirror of
https://github.com/macports/mpbot-github.git
synced 2026-07-13 03:18:39 -07:00
ci: Add log trim indicator
This commit is contained in:
@@ -59,8 +59,10 @@ func (r *remoteLogger) run() {
|
||||
break
|
||||
}
|
||||
// Max 8 MiB
|
||||
if fileSize := fileInfo.Size(); fileSize > 8*1024*1024 {
|
||||
file.Seek(fileSize-8*1024*1024, 0)
|
||||
const trimNote = "*log trimmed*\n"
|
||||
if fileSize := fileInfo.Size(); fileSize > 8*1024*1024-int64(len(trimNote)) {
|
||||
file.Seek(fileSize-8*1024*1024+int64(len(trimNote)), 0)
|
||||
io.WriteString(writer, trimNote)
|
||||
}
|
||||
io.Copy(writer, file)
|
||||
file.Close()
|
||||
|
||||
Reference in New Issue
Block a user