Refactored tasks.py to use celery's log functions.