Debuglog

BlitzPlus Forums/BlitzPlus Beginners Area/Debuglog

acolite246(Posted 2008) [#1]
Hi again
I was wondering if it was possible to save the debug logs to a file on the exit of the program?

It would be really helpful for troubleshooting.

Thanks in advance!


Sauer(Posted 2008) [#2]
What I would do is just write a new function that does both DebugLog and writes to a file at the same time, and just use the new function.

Function xDebugLog(debugstring$)
   fileout=WriteFile("MyDebugLog.txt")
   WriteLine(fileout,debugstring$)
   CloseFile fileout
   DebugLog debugstring$
End Function


Then just use xDebugLog where you would normally use DebugLog.

That may not be perfect (have not tested myself) but it should do what you need I think. I don't even use the Debug console... just a bunch of Print commands to see what I need. But good luck!


acolite246(Posted 2008) [#3]
Thank you!


Sauer(Posted 2008) [#4]
Now that I think about it you may want to do the WriteFile at the start of your program then close it at the end of your program, because I think in the code example I posted it will keep overwriting the line, leaving you with one line at the end.

I could be wrong but that's a possible solution to a problem that may or may not be happening.


acolite246(Posted 2008) [#5]
Thank you for the message, but thankfully I decided to define my file in the initialization process of my code!
Thanks again!