func (c *LogCapture) Entries() []string {
	return c.entries
}
Entries returns all captures log entries.
package logger
import (
	"fmt"
	"strings"
	"sync"
	"testing"
	"github.com/rs/zerolog"
	zerologger "github.com/rs/zerolog/log"
	"github.com/stretchr/testify/assert"
)
type LogCapture struct {
	mu      sync.Mutex
	entries []string
}
func NewLogCapture() *LogCapture {
	c := &LogCapture{
		entries: make([]string, 0),
	}
	zerologger.Logger = zerologger.Logger.Hook(c)
	return c
}
func (c *LogCapture) Run(e *zerolog.Event, level zerolog.Level, msg string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.entries = append(c.entries, msg)
	e.Discard()
}
func (c *LogCapture) AssertHasEntry(t *testing.T, msg string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	for i := range c.entries {
		if c.entries[i] == msg {
			return
		}
	}
	assert.Fail(t, fmt.Sprintf("Missing log message %q", msg), strings.Join(c.entries, "\n"))
}