Update task.py

Adding logger and logging to save logs