func WithLogger(logger *log.Logger) ConsoleOpt {
	return func(opts *ConsoleOpts) error {
		opts.Logger = logger
		return nil
	}
}
WithLogger adds a logger for Console to log debugging information to. By
default Console will discard logs.
package expect
import (
	"bufio"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"os"
	"time"
	"unicode/utf8"
	"github.com/kr/pty"
)
type Console struct {
	opts            ConsoleOpts
	ptm             *os.File
	pts             *os.File
	passthroughPipe *PassthroughPipe
	runeReader      *bufio.Reader
	closers         []io.Closer
}
type ConsoleOpt func(*ConsoleOpts) error
type ConsoleOpts struct {
	Logger          *log.Logger
	Stdins          []io.Reader
	Stdouts         []io.Writer
	Closers         []io.Closer
	ExpectObservers []ExpectObserver
	SendObservers   []SendObserver
	ReadTimeout     *time.Duration
}
type ExpectObserver func(matchers []Matcher, buf string, err error)
type SendObserver func(msg string, num int, err error)
func WithStdout(writers ...io.Writer) ConsoleOpt {
	return func(opts *ConsoleOpts) error {
		opts.Stdouts = append(opts.Stdouts, writers...)
		return nil
	}
}
func WithStdin(readers ...io.Reader) ConsoleOpt {
	return func(opts *ConsoleOpts) error {
		opts.Stdins = append(opts.Stdins, readers...)
		return nil
	}
}
func WithCloser(closer ...io.Closer) ConsoleOpt {
	return func(opts *ConsoleOpts) error {
		opts.Closers = append(opts.Closers, closer...)
		return nil
	}
}