You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/11/11 18:47:04 UTC

[GitHub] [pulsar] candlerb commented on issue #5620: cpp/python API: please log to stderr instead of stdout by default

candlerb commented on issue #5620: cpp/python API: please log to stderr instead of stdout by default
URL: https://github.com/apache/pulsar/issues/5620#issuecomment-552565188
 
 
   I have a workaround:
   
   ```
       fd = os.dup(1)    # copy the original stdout
       os.dup2(2, 1)     # join stdout onto stderr
       new_stdout = os.fdopen(fd, "w")  # wrap the original stdout
   ```
   
   ... then write to `new_stdout` instead of `stdout`.  Anything which is written to fd 1 gets sent to stderr.

----------------------------------------------------------------
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