func (s *Sink) Logs() []Log {
	var logs []Log
	s.Lock()
	logs = append(logs, s.logs...)
	s.Unlock()
	return logs
}
Logs returns a copy of the sink's accumulated logs.
package spy
import (
	"sync"
	"github.com/uber-go/zap"
)
type Log struct {
	Level  zap.Level
	Msg    string
	Fields []zap.Field
}
type Sink struct {
	sync.Mutex
	logs []Log
}
func (s *Sink) WriteLog(lvl zap.Level, msg string, fields []zap.Field) {
	s.Lock()
	log := Log{
		Msg:    msg,
		Level:  lvl,
		Fields: fields,
	}
	s.logs = append(s.logs, log)
	s.Unlock()
}