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

@ -6,7 +6,7 @@
08-2024 INITIAL RELEASE
* Finished hooking up listener and timer
06-2024 INITIAL VERSION
* Manage memory more efficiently than all other current systems
* Channels for dialogs will always be negative
@ -41,7 +41,6 @@ string EXIT_MENU = "-exit-";
string NEXT_MENU = "-->";
integer g_iDebugIndent=0;
@ -51,7 +50,12 @@ returnMenu(key kID, string sMenu, integer iPage, string sReply) {
}
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++;
@ -64,6 +68,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 ++;
@ -76,21 +81,10 @@ DEBUG_STMT(integer iEnter, string sLabel) {
}
DEBUG(string sMsg) {
if(!DEBUG_ENABLED()) return;
llOwnerSay(MakeIndent() + " > " + sMsg);
}
string MakeIndent()
{
integer i = 0;
string sIndent = "";
for(i = 0;i<g_iDebugIndent;i++){
sIndent += " ";
}
return "[" + llGetScriptName() + "] " + sIndent;
}
string SLURL(key kID){
return "secondlife:///app/agent/"+(string)kID+"/about";
}

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);
}