PDA

View Full Version : Debug-mode in the settings



lule
April 5th, 2013, 16:54
Hallo at All!

There are two questions I am looking for an answer. And I think that this place looks like the right one to get them.

1. Is there any way within a ruleset to get the information if the debug-mode is enabled in the settings?
2. Which function has exactly the debug-mode?

Sincerely

Lule

S Ferguson
April 6th, 2013, 17:22
Hallo at All!

There are two questions I am looking for an answer. And I think that this place looks like the right one to get them.

1. Is there any way within a ruleset to get the information if the debug-mode is enabled in the settings?
2. Which function has exactly the debug-mode?

Sincerely

Lule

1) Usually through the console accessed via typing /console in your chat window.
2) The print() command allows you to output directly to the console.

These are built into FG specifically for debugging.

phantomwhale
April 7th, 2013, 06:53
There is also a "Debug" lua module, with Debug.chat and Debug.console commands, as part of the 4E and Savage Worlds ruleset (and others, I dare say). It's VERY useful for development of ANY fantasy grounds lua code.

lule
April 11th, 2013, 13:09
Thanks for your answers. I already know the Debug-Module and the print-Command. Also the console is something I already use alot.

But I don't know what the option in the setting does. Enabled or disabled I can see no difference in the console or the console-logfile. So what is the functionality of that option in the FG2-settigns? And is there a possibility to get the status of that option in a lua-script of a ruleset?

S Ferguson
April 11th, 2013, 15:52
Thanks for your answers. I already know the Debug-Module and the print-Command. Also the console is something I already use alot.

But I don't know what the option in the setting does. Enabled or disabled I can see no difference in the console or the console-logfile. So what is the functionality of that option in the FG2-settigns? And is there a possibility to get the status of that option in a lua-script of a ruleset?

This is assuming I follow you correctly (feel free to tell me if I miss the point). The debug mode (using just the /console and "print" commands can't be "turned off" per se, they have to be commented out, same with the Debug Lua code. Since errors are traps if your program is running properly, there won't be any output to the error console. There won't be a difference as the debug code won't be hit. If. however, your program still displays bugs and there is no indication that there is a bug via the console, it is usually a problem in the extension, ruleset, whatnots logic, which is a whole other beastie.

If you're referring to the "live," "Test," and "Dev" in the Settings option under the loader screen, the reason you might not be able to tell the difference is because rev 2.9.3 is almost a wrap. Caution should be used in these modes, as they are there for system developers only, and are extremely fragile critters, as they're the testing grounds for new features. I was using a standard extension (bought) and it crashed it in "test" mode, and one of my own extensions flopped under it as well. Caveat Codex. It's best just to run it in "live" mode.

Hope this helps,
SF

lule
April 12th, 2013, 16:23
My questions concern this option. I can not see any difference between activated or inactivated.

S Ferguson
April 12th, 2013, 16:40
That's because I believe this is for testing the Fantasy Grounds platform itself, rather than testing code written for FG. Unless you were compiling FG, I don't think you would use this feature normally. It's for tester's of say FGIII in it's build state. At least I was led to believe that's what it's for.

Trenloe
April 15th, 2013, 22:25
My questions concern this option. I can not see any difference between activated or inactivated.
If it is activated you'll see 2 log files created in your base Fantasy Grounds App Data directory: update.log and console.log.

Update.log provides info regarding what happens when you do an update.

Console.log has some initial info regarding FG, but also logs any output that is put into the console during your session. Very handy when you're using the debug commands in custom LUA code to write to the console.

Note: these files are overwritten - update.log when you run an update, console.log when you restart FG.

Trenloe
April 15th, 2013, 22:29
There is also a "Debug" lua module, with Debug.chat and Debug.console commands, as part of the 4E and Savage Worlds ruleset (and others, I dare say). It's VERY useful for development of ANY fantasy grounds lua code.
This is now built in functionality to the FG client - no need to use an extension.

https://www.fantasygrounds.com/refdoc/Debug.xcp

Very handy as part of debugging. It would be nice if the output of these commands, especially Debug.chat, was controlled by the debug mode option we're talking about.

S Ferguson
April 19th, 2013, 17:06
This is now built in functionality to the FG client - no need to use an extension.

https://www.fantasygrounds.com/refdoc/Debug.xcp

Very handy as part of debugging. It would be nice if the output of these commands, especially Debug.chat, was controlled by the debug mode option we're talking about.

Yes, it would be.;)

Moon Wizard
April 19th, 2013, 23:19
The debug mode setting only changes the information saved into the update.log file by the updater. It does not impact the FG host or client at all at this point, though it possibly could in the future. I've reserved this flag for capturing data that is not normally exposed in the console.

Regards,
JPG