Adds a debug toggle

This commit is contained in:
zontreck 2024-08-01 18:31:48 -07:00
parent 775289200c
commit b744b7b923
2 changed files with 15 additions and 14 deletions

View file

@ -70,7 +70,12 @@ returnMenu(key kID, string sMenu, integer iPage, string sReply) {
}
integer g_iDebugIndent=0;
integer DEBUG_ENABLED() {
return FALSE;
}
DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
if(!DEBUG_ENABLED()) return;
if(iEnter){
llOwnerSay(MakeIndent() + "ENTER " + sLabel + " [" + llList2CSV(lParams) + "]");
g_iDebugIndent++;
@ -83,6 +88,7 @@ DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
}
DEBUG_STMT(integer iEnter, string sLabel) {
if(!DEBUG_ENABLED()) return;
if(iEnter) {
llOwnerSay(MakeIndent() + "STMT " + sLabel);
g_iDebugIndent ++;
@ -95,6 +101,7 @@ DEBUG_STMT(integer iEnter, string sLabel) {
}
DEBUG(string sMsg) {
if(!DEBUG_ENABLED()) return;
llOwnerSay(MakeIndent() + " > " + sMsg);
}