From 4e16a90454f85a974e2e2c753594663bea50bf4f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 30 Apr 2020 02:19:32 -0700 Subject: [PATCH] for debugging --- weed/util/log_buffer/sealed_buffer.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weed/util/log_buffer/sealed_buffer.go b/weed/util/log_buffer/sealed_buffer.go index e412b5f32..cade45dd1 100644 --- a/weed/util/log_buffer/sealed_buffer.go +++ b/weed/util/log_buffer/sealed_buffer.go @@ -1,6 +1,9 @@ package log_buffer -import "time" +import ( + "fmt" + "time" +) type MemBuffer struct { buf []byte @@ -53,3 +56,7 @@ func (mb *MemBuffer) locateByTs(lastReadTime time.Time) (pos int) { } return len(mb.buf) } + +func (mb *MemBuffer) String() string { + return fmt.Sprintf("[%v,%v] bytes:%d", mb.startTime, mb.stopTime, mb.size) +} \ No newline at end of file