code: func (cl *ChannelLogger) Flush(logger log.Logger) error {
  	// Grab the buffer at the here rather than within loop condition so that we
  	// do not drain the buffer forever
  	cl.Lock()
  	defer cl.Unlock()
  	bufferLength := cl.BufferLength()
  	var errs []error
  	for i := 0; i < bufferLength; i++ {
  		logLine := cl.WaitReadLogLine()
  		if logLine != nil {
  			err := logger.Log(logLine...)
  			if err != nil {
  				errs = append(errs, err)
  			}
  		}
  	}
  	return errors.CombineErrors(errs)
  }
docs: // Drains everything that is available at the time of calling