func hookWait() {
	time.Sleep(time.Millisecond * 50)
}
hookWait sleeps for a short period to ensure the hook has had chance to fire.
package lrhook
import (
	"bytes"
	"io"
	"os"
	"strings"
	"sync"
	"testing"
	"time"
	"github.com/multiplay/go-slack/chat"
	"github.com/multiplay/go-slack/test"
	"github.com/sirupsen/logrus"
	"github.com/stretchr/testify/assert"
)
type sbuf struct {
	mtx sync.RWMutex
	buf bytes.Buffer
}
func (b *sbuf) Write(p []byte) (n int, err error) {
	b.mtx.Lock()
	defer b.mtx.Unlock()
	return b.buf.Write(p)
}
func (b *sbuf) String() string {
	b.mtx.RLock()
	defer b.mtx.RUnlock()
	return b.buf.String()
}
func (b *sbuf) Reset() {
	b.mtx.Lock()
	defer b.mtx.Unlock()
	b.buf.Reset()
}
var (
	log    = &sbuf{}
	stderr = &sbuf{}
)
func init() {
	r, w, _ := os.Pipe()
	os.Stderr = w
	go io.Copy(stderr, r)
}
func resetBufs() {
	log.Reset()
	stderr.Reset()
}
func newHookedLogger(h logrus.Hook) *logrus.Logger {
	l := logrus.New()
	l.Out = log
	l.Hooks.Add(h)
	return l
}