pyjnius
pyjnius copied to clipboard
Reading java output messages
while doing unit test, is there a way to read java execution output/log messages from python? im trying to use following code to read stdout but its empty.
f = io.StringIO()
with contextlib.redirect_stdout(f):
...pyjnius execution...
print(f.getvalue())
using pyjnius with this project https://github.com/memiiso/pyliquibase
See https://github.com/terrier-org/pyterrier/blob/master/pyterrier/bootstrap.py#L214 This allows Java System.out.println() etc to be redirected to a Jupyter console. I think you could use similar code to redirect to a buffer.
No reply after 2 years. Closing as can't repro.