First time here? Check out the FAQ!
1

Logging- debug I/O to file
 

Is there a way to log the debug I/O output to file to overcome its limited buffer?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
anonymous user
Anonymous
asked 1 year ago
Wingware Support's avatar
4.2k
Wingware Support
updated 1 year ago

Comments

see more comments

2 Answers

0

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 1 year ago
link

Comments

1

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

Massimo's avatar Massimo (1 year ago)

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!

Wingware Support's avatar Wingware Support (1 year ago)

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!

Wingware Support's avatar Wingware Support (1 year ago)
see more comments
0

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 1 year ago
link

Comments

1

Good, this is working

Massimo's avatar Massimo (1 year ago)
see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)