def logSequence(self, fifo=False):
        """ called by conditional actions
            Log and remove all elements of sequence
            Default is lifo order
            If fifo Then log in fifo order
            head is left tail is right
            lifo is log tail to head
            fifo is log head to tail
        """
        self.stamp = self.store.stamp

        #should be different if binary kind
        cf = io.StringIO() #use string io faster than concatenation
        try:
            stamp = self.formats['_time'] % self.stamp
        except __HOLE__:
            stamp = '%s' % self.stamp

        if self.loggees:
            tag, loggee = self.loggees.items()[0] # only works for one loggee
            if loggee: # not empty
                field, value = loggee.items()[0] # only first item
                d = deque()
                if isinstance(value, MutableSequence): #has pop method
                    while value: # not empty
                        d.appendleft(value.pop()) #remove and copy in order

                elif isinstance(value, MutableMapping): # has popitem method
                    while value: # not empty
                        d.appendleft(value.popitem()) #remove and copy in order

                else: #not mutable sequence or mapping so log normally
                    d.appendleft(value)

                while d: # not empty
                    if fifo:
                        element = d.popleft()
                    else: #lifo
                        element = d.pop()

                    try:
                        text = self.formats[tag][field] % (element, )
                    except TypeError:
                        text = '%s' % element
                    cf.write(u"%s\t%s\n" % (stamp, text))

        try:
            self.file.write(cf.getvalue())
        except ValueError as ex: #if self.file already closed then ValueError
            console.terse("{0}\n".format(ex))

        cf.close()
dataset/ETHPy150Open ioflo/ioflo/ioflo/base/logging.py/Log.logSequence