Remove __del__ because the order of del is not guaranteed.

Sometimes the streamhandler is garbage collected before the
loghandler, in which case this makes a bad error.
This commit is contained in:
voussoir 2021-09-23 22:34:02 -07:00
parent 6c0233c239
commit f10942fd3f
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -106,11 +106,6 @@ class LogHandler(vlogging.StreamHandler):
self.notify_every_line = notify_every_line
super().__init__(stream=self.log_buffer)
def __del__(self):
# Remember that del is not guaranteed to execute, but this should help
# out in cases where notify is never called.
self.notify()
def emit(self, record):
# The StreamHandler emit will write the line into the stringio buffer.
super().emit(record)