for debugging

This commit is contained in:
Chris Lu 2020-04-30 02:19:32 -07:00
parent a25a8d8822
commit 4e16a90454

View file

@ -1,6 +1,9 @@
package log_buffer package log_buffer
import "time" import (
"fmt"
"time"
)
type MemBuffer struct { type MemBuffer struct {
buf []byte buf []byte
@ -53,3 +56,7 @@ func (mb *MemBuffer) locateByTs(lastReadTime time.Time) (pos int) {
} }
return len(mb.buf) return len(mb.buf)
} }
func (mb *MemBuffer) String() string {
return fmt.Sprintf("[%v,%v] bytes:%d", mb.startTime, mb.stopTime, mb.size)
}