Disable logging while library update in progress

This commit is contained in:
JonnyWong16 2016-01-18 23:48:31 -08:00
parent 4e0f06f24d
commit 5faf357045
2 changed files with 26 additions and 3 deletions

View file

@ -51,6 +51,17 @@ class LogListHandler(logging.Handler):
plexpy.LOG_LIST.insert(0, (helpers.now(), message, record.levelname, record.threadName))
class NoThreadFilter(logging.Filter):
"""
Log filter for the current thread
"""
def __init__(self, threadName):
self.threadName = threadName
def filter(self, record):
return not record.threadName == self.threadName
@contextlib.contextmanager
def listener():
"""