Skip to content

Commit

Permalink
fix: getlogger hijacking on multiproccessing
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBarton446 committed Apr 21, 2024
1 parent 5e82507 commit 0d2b313
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shogi-ai/util/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_logger(name: str) -> logging.Logger:
logdir.mkdir()

form = "%(asctime)s.%(msecs)03d - %(name)s - %(levelname)s - %(message)s"
time = datetime.now().strftime("%Y%m%d.%H%M%S.%f")
time = datetime.now().strftime("%Y%m%d.%H%M%S")
logging.basicConfig(
filename=f"{logdir}/{name}.{time}.log",
level=logging.INFO,
Expand Down
5 changes: 2 additions & 3 deletions shogi-ai/util/multiproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
"""

import concurrent.futures
import multiprocessing
import os
from concurrent.futures import Future, ProcessPoolExecutor
from functools import partial
from typing import Any, Callable, List

from util.common import get_logger

logger = get_logger(__name__)
logger = multiprocessing.get_logger()


class MultiProcManager:
Expand Down

0 comments on commit 0d2b313

Please sign in to comment.