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 2019/10/25 17:19:16 UTC

[GitHub] [airflow] wjiangqc commented on issue #6389: [AIRFLOW-5663]: Switch to real-time logging in PythonVirtualenvOperator.

wjiangqc commented on issue #6389: [AIRFLOW-5663]: Switch to real-time logging in PythonVirtualenvOperator.
URL: https://github.com/apache/airflow/pull/6389#issuecomment-546438501
 
 
   @mik-laj Seems `print` by default buffers the output so you are not seeing it in real-time. If you use `flush=True` in `print` or switch to `logger.info()`, you will see the outputs in real time (the timestamps show that):
   ```
   [2019-10-25 17:13:14,865] {python_operator.py:333} INFO - Executing cmd
   ['/tmp/venvowai0m98/bin/python', '/tmp/venvowai0m98/script.py', '/tmp/venvowai0m98/script.in', '/tmp/venvowai0m98/script.out', '/tmp/venvowai0m98/string_args.txt']
   [2019-10-25 17:13:14,872] {python_operator.py:339} INFO - Got output
   [2019-10-25 17:13:14,970] {python_operator.py:342} INFO - INFO:__main__:some red text
   [2019-10-25 17:13:14,970] {python_operator.py:342} INFO - INFO:__main__:and with a green background
   [2019-10-25 17:13:14,970] {python_operator.py:342} INFO - INFO:__main__:and in dim text
   [2019-10-25 17:13:14,971] {python_operator.py:342} INFO - INFO:__main__:
   [2019-10-25 17:13:14,972] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:13:24,981] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:13:34,989] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:13:44,959] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:13:54,966] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:14:04,977] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:14:14,953] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:14:24,963] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:14:34,973] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:14:44,950] {python_operator.py:342} INFO - INFO:__main__:Please wait...
   [2019-10-25 17:14:54,966] {python_operator.py:342} INFO - INFO:__main__:Finished
   [2019-10-25 17:14:55,009] {python_operator.py:143} INFO - Done. Returned value was: None
   ```

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


With regards,
Apache Git Services