mirror of
https://github.com/kristoferssolo/2048.git
synced 2025-10-21 15:20:35 +00:00
16 lines
386 B
Python
16 lines
386 B
Python
from pathlib import Path
|
|
|
|
from loguru import logger
|
|
|
|
BASE_PATH = Path(__file__).resolve().parent.parent.parent
|
|
|
|
|
|
def setup_logger() -> None:
|
|
logger.add(
|
|
BASE_PATH.joinpath(".logs", "game.log"),
|
|
format="{time} | {level} | {message}",
|
|
level="DEBUG" if BASE_PATH.joinpath("debug").exists() else "INFO",
|
|
rotation="1 MB",
|
|
compression="zip",
|
|
)
|