ashb commented on a change in pull request #7288: [AIRFLOW-6672] AWS DataSync -
better logging of error message
URL: https://github.com/apache/airflow/pull/7288#discussion_r372622186
##########
File path: airflow/providers/amazon/aws/operators/datasync.py
##########
@@ -350,6 +350,16 @@ def _execute_datasync_task(self):
)
self.log.info("task_execution_description=%s",
task_execution_description)
+
+ # Log some meaningful statuses
+ log = self.log.info
+ if not result:
+ log = self.log.error
Review comment:
This is a slightly odd way. Instead could you do:
```python
level = logging.ERROR if not result else logging.INFO
self.log.log(level, 'Status=%s',
task_execution_description['Status'])
```
etc. (Probably need `import logging` at the top of the file to get access to
those constants)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services