コード例 #1
0
ファイル: test_regular.py プロジェクト: florentx/logbook
 def send_back():
     handler = MultiProcessingHandler(queue)
     handler.push_thread()
     try:
         logbook.warn(message)
     finally:
         handler.pop_thread()
コード例 #2
0
ファイル: logging.py プロジェクト: aragilar/DiscSolver
def start_logging_in_process(queue):
    """
    Start logging in multiprocessing process
    """
    if queue is not None:
        mp_handler = MultiProcessingHandler(queue)
        mp_handler.push_application()
コード例 #3
0
 def __call__(self):
     from logbook.queues import MultiProcessingHandler
     handler = MultiProcessingHandler(self.queue)
     handler.push_thread()
     try:
         logbook.warn('Hello World')
     finally:
         handler.pop_thread()
コード例 #4
0
ファイル: logging.py プロジェクト: aragilar/DiscSolver
def enable_multiprocess_log_handing(args):
    """
    Set up logging when using multiprocessing
    """
    normal_handler = log_handler(args, thread_wrapping=False)
    manager = multiprocessing.Manager()
    queue = manager.Queue(-1)
    mp_handler = MultiProcessingHandler(queue)
    mp_handler.push_application()
    mp_sub = MultiProcessingSubscriber(queue)
    mp_sub.dispatch_in_background(normal_handler)
    return queue
コード例 #5
0
ファイル: test_queues.py プロジェクト: senthil10/logbook
 def __call__(self):
     from logbook.queues import MultiProcessingHandler
     handler = MultiProcessingHandler(self.queue)
     handler.push_thread()
     try:
         logbook.warn('Hello World')
     finally:
         handler.pop_thread()
コード例 #6
0
ファイル: extract.py プロジェクト: tuokri/rs2-audio-extractor
def setup_logging(queue: mp.Queue):
    logbook.set_datetime_format("local")
    handler = MultiProcessingHandler(queue)
    handler.push_application()
コード例 #7
0
ファイル: test_queues.py プロジェクト: senthil10/logbook
 def __call__(self):
     from logbook.queues import MultiProcessingHandler
     with MultiProcessingHandler(self.queue):
         logbook.warn(self.message)