code: func NewLogger(sink io.Writer, options ...Option) *Logger {
  	if sink == nil {
  		sink = ioutil.Discard
  	}
  
  	l := &Logger{
  		sink:     sink,
  		throttle: DefaultLoggingThrottle,
  		widthFn: func() int {
  			size, err := ts.GetSize()
  			if err != nil {
  				return 80
  			}
  			return size.Col()
  		},
  		queue: make(chan Task),
  		tasks: make(chan Task),
  		wg:    new(sync.WaitGroup),
  	}
  
  	for _, option := range options {
  		option(l)
  	}
  
  	l.tty = tty(sink)
  
  	go l.consume()
  
  	return l
  }
docs: // NewLogger retuns a new *Logger instance that logs to "sink" and uses the
  // current terminal width as the width of the line. Will log progress status if
  // stdout is a terminal or if forceProgress is true