28 lines
873 B
Python
Executable File
28 lines
873 B
Python
Executable File
#!/usr/bin/env python3
|
|
import logging
|
|
import traceback
|
|
from crossfit_booker import CrossFitBooker
|
|
|
|
if __name__ == "__main__":
|
|
# Configure logging once at script startup
|
|
logging.basicConfig(
|
|
level=logging.DEBUG, # Change to DEBUG for more detailed logs
|
|
format='%(asctime)s - %(levelname)s - %(message)s',
|
|
handlers=[
|
|
logging.FileHandler("log/crossfit_booking.log"),
|
|
logging.StreamHandler()
|
|
]
|
|
)
|
|
|
|
logging.getLogger("requests").setLevel(logging.WARNING)
|
|
logging.info("Logging enhanced with request library noise reduction")
|
|
|
|
# Start the main runner
|
|
booker = CrossFitBooker()
|
|
if not booker.login():
|
|
logging.error("Failed to login - Traceback: %s", traceback.format_exc())
|
|
exit(1)
|
|
|
|
# Start continuous booking loop
|
|
booker.run()
|
|
logging.info("Script completed") |