Shop OBEX P1 Docs P2 Docs Learn Events
Debug Window size - solved, log file - still looking for help — Parallax Forums

Debug Window size - solved, log file - still looking for help

BtussBtuss Posts: 20
edited 2021-01-07 00:51 in Propeller 2
I would appreciate it if someone would explain how to control the size and placement of the debug window. Mine comes up as a short box the width of my screen. I see symbols to modify debug behavior (debug_left, debug_height, etc) but I haven't figured out the syntax to use them. Solved by using pnut version 35E
Also any information on the debug log file. I see debug_log_size but I cant find a generated debug.log file. Thanks

Comments

  • oops. I thought i had the latest version of pnut but I just found Version 35E and that allows me to resize and move the window and it stays put.
  • (Go edit your first post and put "Solved" in the title.)
  • Francis BauerFrancis Bauer Posts: 353
    edited 2021-01-29 07:55

    While the resize and move part of btuss's original question was answered/solved with Version 35e.


    The question about getting the "Debug.log" mechanism working is still open.


    I've tried using the "DEBUG_LOG_SIZE" attribute, but I can't find the correct syntax/format to get it to work and produce a log file.


    @cgracey Can you provide an example on how to use the debug log file mechanism to create a log file, thank you.

  • cgraceycgracey Posts: 14,133
    edited 2021-01-29 18:07

    Francis,


    To generate a DEBUG.log file of 10,000 bytes, maximum, put this at the start of your top-level Spin2 file:


    CON debug_log_size = 10_000


    The DEBUG.log file will be opened and written with DEBUG data. It will close when either 10,000 bytes are written or you close the DEBUG windows.


    Here is an example program that generates a DEBUG.log file:



    NOTE: In testing the example program above, I discovered a bug in PNut.exe. Depending on how DEBUG windows were being closed, the DEBUG.log file was not being reset when rewritten. This was causing an I/O error. I made a new PNut_v35f that you'll need. Use this latest version:


    https://drive.google.com/file/d/1VMHnSO4sf7-hTPewo-SH91PsvA5XBPZb/view?usp=sharing

  • Thank you , Chip. I've downloaded a copy of the new PNut v35f version.

  • Francis BauerFrancis Bauer Posts: 353
    edited 2021-02-01 00:36

    @cgracey Chip,

    I've been using debug with DEBUG.log saving in PNut-v35f and have noticed that it sometimes doesn't do a flush buffer write to the file at the end of the program even if I manually close the debug windows or even PNut-v35f itself. The last few lines don't get saved into the file. So far the only way I have been able to get a complete copy of all the pertinent debug data lines into the DEBUG.log file is to add just enough additional output lines of "anything" that causes a another buffer write into the file. Of course some of those "anything" lines don't get saved, but at least all the actual data lines get saved. I get the same results when I use the PNut-v35e version too.

    I noticed this issue at first when I was writing more that the maximum 10,000 characters into the file. I started trimming my output to be less the 10,000 (for example 8,000 or so), but I was still seeing the last data lines being left out of the file.

    Perhaps we need to have a special debug command that we can specify in our code when we want to do a write buffer flush to the DEBUG.log file to ensure all the data gets recorded before we end our programs.

  • I have the same Error.

    I think when you close the DEBUG Window with "Debug Toggle", the DEBUG.LOG will be closed.

    But the Buffer is not flushed and the last Lines are missed.

Sign In or Register to comment.