def prepare(self):
        console.profuse("     Preparing formats for Log {0}\n".format(self.name))

        #build header
        cf = io.StringIO()
        cf.write(ns2u(self.kind))
        cf.write(u'\t')
        cf.write(ns2u(LogRuleNames[self.rule]))
        cf.write(u'\t')
        cf.write(ns2u(self.fileName))
        cf.write(u'\n')
        cf.write(u'_time')
        for tag, loggee in self.loggees.items():
            if len(loggee) > 1:
                for field in loggee:
                    cf.write(u'\t')
                    cf.write(ns2u(tag))
                    cf.write(u'.')
                    cf.write(ns2u(field))
            else:
                cf.write(u'\t')
                cf.write(ns2u(tag))

        cf.write(u'\n')
        self.header = cf.getvalue()
        cf.close()

        #should be different if binary kind
        #build formats
        self.formats.clear()
        self.formats['_time'] = '%0.4f'
        for tag, loggee in self.loggees.items():
            self.formats[tag] = odict()
            for field, value in loggee.items():
                self.formats[tag][field] = self.format(value)

        #build last copies for if changed
        self.lasts.clear()
        for tag, loggee in self.loggees.items():
            self.lasts[tag] = storing.Data(loggee.items())  #make copy of loggee data

        if self.stamp is None: #never logged so log headers
            self.file.write(self.header)
Prepare log formats and values
dataset/ETHPy150Open ioflo/ioflo/ioflo/base/logging.py/Log.prepare