Adds a debug toggle
This commit is contained in:
parent
775289200c
commit
b744b7b923
2 changed files with 15 additions and 14 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
08-2024 INITIAL RELEASE
|
08-2024 INITIAL RELEASE
|
||||||
* Finished hooking up listener and timer
|
* Finished hooking up listener and timer
|
||||||
|
|
||||||
06-2024 INITIAL VERSION
|
06-2024 INITIAL VERSION
|
||||||
* Manage memory more efficiently than all other current systems
|
* Manage memory more efficiently than all other current systems
|
||||||
* Channels for dialogs will always be negative
|
* Channels for dialogs will always be negative
|
||||||
|
@ -41,7 +41,6 @@ string EXIT_MENU = "-exit-";
|
||||||
string NEXT_MENU = "-->";
|
string NEXT_MENU = "-->";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
integer g_iDebugIndent=0;
|
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) {
|
DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
|
||||||
|
if(!DEBUG_ENABLED()) return;
|
||||||
if(iEnter){
|
if(iEnter){
|
||||||
llOwnerSay(MakeIndent() + "ENTER " + sLabel + " [" + llList2CSV(lParams) + "]");
|
llOwnerSay(MakeIndent() + "ENTER " + sLabel + " [" + llList2CSV(lParams) + "]");
|
||||||
g_iDebugIndent++;
|
g_iDebugIndent++;
|
||||||
|
@ -64,6 +68,7 @@ DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_STMT(integer iEnter, string sLabel) {
|
DEBUG_STMT(integer iEnter, string sLabel) {
|
||||||
|
if(!DEBUG_ENABLED()) return;
|
||||||
if(iEnter) {
|
if(iEnter) {
|
||||||
llOwnerSay(MakeIndent() + "STMT " + sLabel);
|
llOwnerSay(MakeIndent() + "STMT " + sLabel);
|
||||||
g_iDebugIndent ++;
|
g_iDebugIndent ++;
|
||||||
|
@ -76,21 +81,10 @@ DEBUG_STMT(integer iEnter, string sLabel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(string sMsg) {
|
DEBUG(string sMsg) {
|
||||||
|
if(!DEBUG_ENABLED()) return;
|
||||||
llOwnerSay(MakeIndent() + " > " + sMsg);
|
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){
|
string SLURL(key kID){
|
||||||
return "secondlife:///app/agent/"+(string)kID+"/about";
|
return "secondlife:///app/agent/"+(string)kID+"/about";
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,12 @@ returnMenu(key kID, string sMenu, integer iPage, string sReply) {
|
||||||
}
|
}
|
||||||
|
|
||||||
integer g_iDebugIndent=0;
|
integer g_iDebugIndent=0;
|
||||||
|
integer DEBUG_ENABLED() {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
|
DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
|
||||||
|
if(!DEBUG_ENABLED()) return;
|
||||||
if(iEnter){
|
if(iEnter){
|
||||||
llOwnerSay(MakeIndent() + "ENTER " + sLabel + " [" + llList2CSV(lParams) + "]");
|
llOwnerSay(MakeIndent() + "ENTER " + sLabel + " [" + llList2CSV(lParams) + "]");
|
||||||
g_iDebugIndent++;
|
g_iDebugIndent++;
|
||||||
|
@ -83,6 +88,7 @@ DEBUG_FUNC(integer iEnter, string sLabel, list lParams) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_STMT(integer iEnter, string sLabel) {
|
DEBUG_STMT(integer iEnter, string sLabel) {
|
||||||
|
if(!DEBUG_ENABLED()) return;
|
||||||
if(iEnter) {
|
if(iEnter) {
|
||||||
llOwnerSay(MakeIndent() + "STMT " + sLabel);
|
llOwnerSay(MakeIndent() + "STMT " + sLabel);
|
||||||
g_iDebugIndent ++;
|
g_iDebugIndent ++;
|
||||||
|
@ -95,6 +101,7 @@ DEBUG_STMT(integer iEnter, string sLabel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(string sMsg) {
|
DEBUG(string sMsg) {
|
||||||
|
if(!DEBUG_ENABLED()) return;
|
||||||
llOwnerSay(MakeIndent() + " > " + sMsg);
|
llOwnerSay(MakeIndent() + " > " + sMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue