Example #1
0
 def hash_record_raw(self, record):
     """Returns a hashlib object with the hash of the record."""
     hash = sha1()
     hash.update(('%d\x00' % record.level).encode('ascii'))
     hash.update((record.channel or u'').encode('utf-8') + b('\x00'))
     hash.update(record.filename.encode('utf-8') + b('\x00'))
     hash.update(b(str(record.lineno)))
     return hash
Example #2
0
 def hash_record_raw(self, record):
     """Returns the unique hash of a record."""
     hash = HashingHandlerMixin.hash_record_raw(self, record)
     if self.hash_salt is not None:
         hash_salt = self.hash_salt
         if not PY2 or isinstance(hash_salt, unicode):
             hash_salt = hash_salt.encode('utf-8')
         hash.update(b('\x00') + hash_salt)
     return hash
Example #3
0
 def hash_record_raw(self, record):
     """Returns the unique hash of a record."""
     hash = HashingHandlerMixin.hash_record_raw(self, record)
     if self.hash_salt is not None:
         hash_salt = self.hash_salt
         if not PY2 or isinstance(hash_salt, unicode):
             hash_salt = hash_salt.encode('utf-8')
         hash.update(b('\x00') + hash_salt)
     return hash