Fix printing output in aiomonitor console #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
orsys.stdout.write
just the plainprint
function is used.But feature of redirecting the output into a file or other stream is still working just as expected.