#!/usr/bin/env python3
"""
Main application entry point.
Runs ACH file processing scheduler.
"""

import logging
from logging_config import setup_logging, get_logger
from scheduler import Scheduler

# Initialize logging
logging.getLogger("paramiko").setLevel(logging.WARNING)
logger = setup_logging(log_level=logging.INFO)
app_logger = get_logger(__name__)


def main():
    """Main application function."""
    app_logger.info("Application started")

    try:
        # Run the scheduler
        scheduler = Scheduler()
        scheduler.run()
        app_logger.info("Application completed successfully")
    except KeyboardInterrupt:
        app_logger.info("Application interrupted by user")
    except Exception as e:
        app_logger.error(f"An error occurred: {e}", exc_info=True)
        raise


if __name__ == "__main__":
    main()
