Logging- debug I/O to file
Is there a way to log the debug I/O output to file to overcome its limited buffer?
Is there a way to log the debug I/O output to file to overcome its limited buffer?
You can use an external console by selecting the Configure External Console item in the Debug I/O tool's Options menu. That doesn't have an I/O limit like the integrated Debug I/O tool.
No, it has a line limit, much more limited than the integrated Debug I/O tool. You can change the limit, but up to 999 lines maximum
Oh, sorry, I misunderstood and thought you were referring to the rate limit on the integrated Debug I/O tool. What OS are you on? I'm surprised any modern console implementation would limit to 999 lines max!
Incidentally, we'll try to see if we can increase or make the line limit in the Debug I/O tool configurable. It looks like it's currently 100K lines, which apparently we thought would be "enough for anyone" at some point in the past. Do you have a sense for how many lines would be enough for you, in case we just change the hardwired max? Actually even if we make it configurable, I'd like to make sure it still works reasonably when there are as many lines as you're expecting. Thanks!
Another approach to this is to change sys.stdout and/or sys.stderr in your code to route output to a file. Something like:
import sys
f = open('output.txt', 'w')
old = sys.stdout
sys.stdout = f
...
sys.stdout = old
f.close()
You can of course do this conditionally, possibly only when 'WINGDB_ACTIVE' in os.environ is true, which is only the case when Wing's debugger is active.
Good, this is working
To enter a block of code:
Comments