mgedmin / objgraph

Visually explore Python object graphs
http://mg.pov.lt/objgraph/
MIT License
768 stars 72 forks source link

Fix printing output in aiomonitor console #64

Open dolfinus opened 3 years ago

dolfinus commented 3 years ago

Hi.

I've faced with a leaking memory in asynchronous one of my applications. I've installed aiomonitor package which allows me to investigate an issue without interrupting the main thread (like gdb does).

But objgraph package functions do not show any output. This is because sys.stdout in the main thread is the whole application output, not the current console. But aiomonitor handles print function calls and shows the result into the current console instead of whole application log.

So I've changed the way objgraph is showing the output - instead of using print(file=sys.stdout) or sys.stdout.write just the plain print function is used. But feature of redirecting the output into a file or other stream is still working just as expected.

dolfinus commented 2 years ago

Any updates here?

dolfinus commented 2 years ago

@mgedmin Could you please take a look?