You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for this very handy package, it turned out quite useful! There is one thing I would like to implement in my code however, but I do not know how or whether it is possible (my IO experience is limited).
I have a C++ library that does some lengthy computations. I use wurlitzer to capture the printout and pass it through my python logging object (to prettify it, but also capture the printout when the log is saved to file). The issue is however that the printout is then saved at the end of the computation, but the program outputs lines every so often, and can take up to several minutes or dozens. With wurlitzer this means that for the entire duration of the computation, I am waiting blindly.
Is there a way (with or without wurlitzer), to obtain every new line and pass it through the logger (or any other output), while the computation is still ongoing ? Maybe a loop that checks regularly if something was added to the stdout and does something with it ?
Thanks in advance !
The text was updated successfully, but these errors were encountered:
wurlitzer does capture continuously in a background thread.
This notebook illustrates continuously capturing output to a Python logger.
If this is asking for capturing output while a program is holding the GIL for a long time, that can't be implemented in Python. We would have to reimplement this with a GIL-less version where all the code to read the pipes runs without the GIL, e.g. in Rust or Cython or some such.
Hi,
Thanks a lot for this very handy package, it turned out quite useful! There is one thing I would like to implement in my code however, but I do not know how or whether it is possible (my IO experience is limited).
I have a C++ library that does some lengthy computations. I use wurlitzer to capture the printout and pass it through my python logging object (to prettify it, but also capture the printout when the log is saved to file). The issue is however that the printout is then saved at the end of the computation, but the program outputs lines every so often, and can take up to several minutes or dozens. With wurlitzer this means that for the entire duration of the computation, I am waiting blindly.
Is there a way (with or without wurlitzer), to obtain every new line and pass it through the logger (or any other output), while the computation is still ongoing ? Maybe a loop that checks regularly if something was added to the
stdout
and does something with it ?Thanks in advance !
The text was updated successfully, but these errors were encountered: