You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/09/08 07:16:13 UTC

[GitHub] Fokko commented on a change in pull request #3862: [AIRFLOW-1917] Remove extra newline character from log

Fokko commented on a change in pull request #3862: [AIRFLOW-1917] Remove extra newline character from log
URL: https://github.com/apache/incubator-airflow/pull/3862#discussion_r216123243
 
 

 ##########
 File path: airflow/utils/log/logging_mixin.py
 ##########
 @@ -92,7 +92,7 @@ def write(self, message):
             self._buffer += message
         else:
             self._buffer += message
-            self.logger.log(self.level, self._buffer)
+            self.logger.log(self.level, self._buffer.rstrip('\n'))
 
 Review comment:
   @r39132 I think you will get this `\n` for free, therefore I think this is a good change. Wouldn't `.rstrip()` be sufficient, to also trim all kinds of whitespace at the end.
   ```
   MacBook-Pro-van-Fokko:~ fokkodriesprong$ python3
   Python 3.7.0 (default, Jun 29 2018, 20:13:13) 
   [Clang 9.1.0 (clang-902.0.39.2)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> 'hoi\n'
   'hoi\n'
   >>> 'hoi\n'.rstrip()
   'hoi'
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services