Commit a62cc3f3 authored by mova's avatar mova
Browse files

add multiprocess-logging

parent 4d985b7c
import logging
from multiprocessing_logging import install_mp_handler
from rich.highlighter import NullHighlighter
from rich.logging import RichHandler
from tqdm.contrib.logging import logging_redirect_tqdm
......@@ -9,12 +10,10 @@ from ..config import conf
logger = logging.getLogger(__name__)
if not logger.handlers:
format = "%(asctime)s - %(levelname)s - %(message)s"
logging.basicConfig(
filename=conf.path.log,
filemode="w",
format=format,
format="%(asctime)s - %(levelname)s - %(message)s",
datefmt="%y-%m-%d %H:%M",
)
logger.setLevel(logging.DEBUG if conf.debug else logging.INFO)
......@@ -24,3 +23,4 @@ if not logger.handlers:
)
logger.addHandler(streamhandler)
logging_redirect_tqdm(logger)
install_mp_handler(logger)
......@@ -35,6 +35,7 @@ install_requirements = [
"toml",
"tblib",
"rich",
"multiprocessing-logging",
]
extras = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment