Exemplo n.º 1
0
 def logstr(self):
     result = []
     formater = LogFormatter(color=False)
     for record in self.logs:
         if isinstance(record, basestring):
             result.append(pretty_unicode(record))
         else:
             if record.exc_info:
                 a, b, tb = record.exc_info
                 tb = hide_me(tb, globals())
                 record.exc_info = a, b, tb
             result.append(pretty_unicode(formater.format(record)))
             result.append(u'\n')
     return u''.join(result)
Exemplo n.º 2
0
 def logstr(self):
     result = []
     formater = LogFormatter(color=False)
     for record in self.logs:
         if isinstance(record, six.string_types):
             result.append(pretty_unicode(record))
         else:
             if record.exc_info:
                 a, b, tb = record.exc_info
                 tb = hide_me(tb, globals())
                 record.exc_info = a, b, tb
             result.append(pretty_unicode(formater.format(record)))
             result.append(u'\n')
     return u''.join(result)
Exemplo n.º 3
0
    def logstr(self):
        """handler the log records to formatted string"""

        result = []
        formater = LogFormatter(color=False)
        for record in self.logs:
            if isinstance(record, six.string_types):
                result.append(pretty_unicode(record))
            else:
                if record.exc_info:
                    a, b, tb = record.exc_info
                    tb = hide_me(tb, globals())
                    record.exc_info = a, b, tb
                result.append(pretty_unicode(formater.format(record)))
                result.append(u'\n')
        return u''.join(result)
Exemplo n.º 4
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)
Exemplo n.º 5
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)