SetDebug lets you control the debugging level.
The available modes are:
“console”: allows console.log messages
“ds”: allows app.Debug messages
“adb”: allows adb debug messages (ie at apk startup)
true: enable all debug messages
false or “” : disable all debug messages
Note that debugging is disabled in apk release mode by default. Otherwise it is always enabled at start.
See Also: Debug, GetDebug, IsDebugging
Example - Demonstration
function OnStart()
{
app.CreateDebug();
app.Debug("default 1");
console.log("default 2");
app.SetDebug("adb");
app.Debug("adb 3");
console.log("adb 4");
app.SetDebug("console");
app.Debug("console 5");
console.log("console 6");
app.SetDebug("ds");
app.Debug("ds 7");
console.log("ds 8");
app.SetDebug("");
app.Debug("null 9");
console.log("null 10");
app.SetDebug("true");
app.Debug("true 11");
console.log("true 12");
app.SetDebug("false");
app.Debug("hello 13");
console.log("hello 14");
}
from native import app
def OnStart():
app.CreateDebug()
app.Debug("default 1")
print("default 2")
app.SetDebug("adb")
app.Debug("adb 3")
print("adb 4")
app.SetDebug("console")
app.Debug("console 5")
print("console 6")
app.SetDebug("ds")
app.Debug("ds 7")
print("ds 8")
app.SetDebug("")
app.Debug("null 9")
print("null 10")
app.SetDebug("true")
app.Debug("true 11")
print("true 12")
app.SetDebug("false")
app.Debug("hello 13")
print("hello 14")