Is there any way to save the debuglog's contents after an error or when the game shutsdown? I don't really want any extra code with the debuglog cammand.
This is the only way:
Global debugfile
Debug "testing"
Debug "testing2"
Function Debug(txt$)
DebugLog txt
If Not debugfile
debugfile = WriteFile("mydebug.txt")
If Not debugfile Then RuntimeError "Can't record debug"
EndIf
WriteLine debugfile,txt
End Function