def logstr(self): result = [] formater = LogFormatter(color=False) for record in self.logs: if isinstance(record, basestring): result.append(record) continue else: if record.exc_info: a, b, tb = record.exc_info tb = hide_me(tb, globals()) record.exc_info = a, b, tb result.append(formater.format(record)) result.append('\n') return ''.join(result)
def logstr(self): result = [] formater = LogFormatter(color=False) for record in self.logs: if isinstance(record, basestring): result.append(record) continue else: if record.exc_info: a, b, tb = record.exc_info tb = hide_me(tb, globals()) record.exc_info = a, b, tb result.append(formater.format(record)) result.append('\n') ret = ''.join(result) if isinstance(ret, unicode): return ret else: try: return ret.decode('utf8') except UnicodeDecodeError as e: return repr(ret)