Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)