import logging


def setup_logger():
    # Create a logger object
    logger = logging.getLogger("BalloonAppLogger")
    logger.setLevel(logging.DEBUG)  # Adjust this for production use

    # Create file handler which logs even debug messages
    fh = logging.FileHandler("balloon_app.log")
    fh.setLevel(logging.DEBUG)  # Adjust this as needed

    # Create formatter and add it to the handlers
    formatter = logging.Formatter(
        "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
    )
    fh.setFormatter(formatter)

    # Add the handlers to the logger
    logger.addHandler(fh)

    return logger


# Set up the logger immediately when this module is imported
logger = setup_logger()
