func WaitRecord(ch chan *log.Record, timeout time.Duration) *log.Record {
	select {
	case record := <-ch:
		return record
	case <-time.After(timeout):
		return nil
	}
}
func WaitRecord(ch chan *log.Record, timeout time.Duration) *log.Record {
	select {
	case record := <-ch:
		return record
	case <-time.After(timeout):
		return nil
	}
}
// WaitRecord blocks until a log.Record is received on the given channel. It
// returns the emitted record, or nil if no record was received within the
// given timeout. Useful in conjunction with log.ChannelHandler, for
// asynchronous testing.