Python - asynchronous logging -
i need log plenty of data while running system code. logging packages can use have efficient, asynchronous logging? standard python logging package (https://docs.python.org/2/library/logging.html) asynchronous default?
you can execute logging.info()
message using pool of n worker, uing concurrent.futures.threadpoolexecutor, n should equals 1 :
import concurrent.futures import logging executor = concurrent.futures.threadpoolexecutor(max_workers=1) def info(self, msg, *args): executor.submit(logging.info, msg, *args)
wiki
Comments
Post a Comment