def run(self):
""" Running logging thread
?????????????
.. note::
??????`threading.Thread <http://docs.python.jp/\
3/library/threading.html#thread-objects>`_ ?????????
??????????????start() ???????????????
???????????????self.stop.set()???????
????????????????????????????????????????
?????????????????????????????????????????
"""
# queue check
assert self.queue is not None, \
"Log Queue is None, use Logger.setQueue(queue) before calling me."
self.stop = threading.Event()
while not self.stop.is_set():
res = self.queue.get()
if getattr(res, '__hash__', False) and res in self.mode:
log_func = self.mode[res]
if res == 'END':
self.stop.set()
continue
self.__call__(log_func(res))
self.post_log()
评论列表
文章目录