BasPH commented on a change in pull request #4716: [AIRFLOW-3896] Add running 
command logging back to SSHOperator
URL: https://github.com/apache/airflow/pull/4716#discussion_r257449904
 
 

 ##########
 File path: airflow/contrib/operators/ssh_operator.py
 ##########
 @@ -99,6 +99,8 @@ def execute(self, context):
                 if self.command.startswith('sudo'):
                     get_pty = True
 
+                self.logger.info("Running command: {0}".format(self.command))
 
 Review comment:
   `self.logger` is deprecated in favour of `self.log`.
   
   Also, with `"".format()` Python constructs the string beforehand so with 
logging this form is preferred: `self.log.info("Running command: %s", 
self.command)` which constructs a string only when this statement is evaluated.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to