import logging
from dotenv import dotenv_values

class Config:
    def __init__(self):
        env = dotenv_values(".env")
        self.log_level_str = (env.get("LOG_LEVEL") or "DEBUG").upper()
        
        self.level_map = {
            "DEBUG": logging.DEBUG,
            "INFO": logging.INFO,
            "WARNING": logging.WARNING,
            "ERROR": logging.ERROR
        }

    @property
    def log_level(self):
        return self.level_map.get(self.log_level_str, logging.DEBUG)

settings = Config()