import os

from loguru import logger

from datetime import datetime

log_month = datetime.now().strftime("%Y-%m")
logger.remove()

log_dir = os.path.expanduser("~/office_helper_log")
os.makedirs(log_dir, exist_ok=True)
log_file = os.path.join(log_dir, f"log_{datetime.now().strftime('%Y-%m-%d')}.log")
logger.add(log_file, format="{time} {level} {message}",
           rotation="100 MB", retention="1 week", compression=None)
