import sys
from config import Config
import os
from loguru import logger as log
from datetime import datetime

settings = Config("config/config.yaml")
from .utils.icon import Icon

__version__ = "0.1.0"
__author__ = "Alexander Kirchner"


if not os.path.exists("logs"):
    os.mkdir("logs")
    # open and close the file to create it
logger = log
logger.remove()
logger.add("logs/application.log", rotation="1 week", enqueue=True)
log.add(
    f"logs/{datetime.now().strftime('%Y-%m-%d')}.log",
    rotation="1 day",
    compression="zip",
)

# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO")
logger.add(sys.stdout)
