blob: 2e5f524588b4c762c107d16546d676e7c33b10d6 [file] [log] [blame]
package main
import (
"strings"
"sync"
)
type Log struct {
l sync.Mutex
d strings.Builder
}
func (l *Log) Write(p []byte) (n int, err error) {
l.l.Lock()
defer l.l.Unlock()
// TODO(gio): Reset s.logs periodically
return l.d.Write(p)
}
func (l *Log) Contents() string {
l.l.Lock()
defer l.l.Unlock()
return l.d.String()
}