Ejemplo n.º 1
0
 def __call__(self, record, handler):
     formatted = StringFormatter.__call__(self, record, handler)
     rv = []
     length = 0
     for piece in _ws_re.split(formatted):
         length += len(piece)
         if length > self.max_length:
             if length - len(piece) < self.max_length:
                 rv.append(u'…')
             break
         rv.append(piece)
     return u''.join(rv)
Ejemplo n.º 2
0
 def __call__(self, record, handler):
     formatted = StringFormatter.__call__(self, record, handler)
     rv = []
     length = 0
     for piece in _ws_re.split(formatted):
         length += len(piece)
         if length > self.max_length:
             if length - len(piece) < self.max_length:
                 rv.append(u('…'))
             break
         rv.append(piece)
     return u('').join(rv)