Back

SetDebug

Hello World

SetDebug lets you control the debugging level.

app.SetDebug( switches )

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, IsDebugging

Example - Demonstration

function OnStart()
{
    app.CreateDebug();

    app.Debug("default 1"); // default on
    console.log("default 2"); // default on

    app.SetDebug("adb");
    app.Debug("adb 3");     // off
    console.log("adb 4");     // off

    app.SetDebug("console");
    app.Debug("console 5"); // off
    console.log("console 6"); // on

    app.SetDebug("ds");
    app.Debug("ds 7");        // on
    console.log("ds 8");     // off

    app.SetDebug("");
    app.Debug("null 9");     // off
    console.log("null 10"); // off

    app.SetDebug("true");
    app.Debug("true 11");     // on
    console.log("true 12"); // on

    app.SetDebug("false");
    app.Debug("hello 13");    // off
    console.log("hello 14"); // off
}
    Copy     Copy All       Run      
string: comma “,” separated: “console”, “ds”, “adb”, “all”