def log_write(self, data, kind='<STR_LIT:input>'):
<EOL>if self.log_active and data:<EOL><INDENT>write = self.logfile.write<EOL>if kind=='<STR_LIT:input>':<EOL><INDENT>if self.timestamp:<EOL><INDENT>write(str_to_unicode(time.strftime('<STR_LIT>',<EOL>time.localtime())))<EOL><DEDENT>write(data)<EOL><DEDENT>elif kind=='<STR_LIT>' and self.log_output:<EOL><INDENT>odata = '<STR_LIT:\n>'.join(['<STR_LIT>' % s<EOL>for s in data.splitlines()])<EOL>write('<STR_LIT>' % odata)<EOL><DEDENT>self.logfile.flush()<EOL><DEDENT>
Write data to the log file, if active