mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 06:41:51 +00:00
GUI: Add "debuglevel" command to Debugger base class.
This allows the debug level to be changed at runtime from the debug console.
This commit is contained in:
parent
0549ae8259
commit
bc7af1de19
@ -61,6 +61,7 @@ Debugger::Debugger() {
|
||||
DCmd_Register("help", WRAP_METHOD(Debugger, Cmd_Help));
|
||||
DCmd_Register("openlog", WRAP_METHOD(Debugger, Cmd_OpenLog));
|
||||
|
||||
DCmd_Register("debuglevel", WRAP_METHOD(Debugger, Cmd_DebugLevel));
|
||||
DCmd_Register("debugflag_list", WRAP_METHOD(Debugger, Cmd_DebugFlagsList));
|
||||
DCmd_Register("debugflag_enable", WRAP_METHOD(Debugger, Cmd_DebugFlagEnable));
|
||||
DCmd_Register("debugflag_disable", WRAP_METHOD(Debugger, Cmd_DebugFlagDisable));
|
||||
@ -501,6 +502,22 @@ bool Debugger::Cmd_OpenLog(int argc, const char **argv) {
|
||||
}
|
||||
|
||||
|
||||
bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
|
||||
if (argc == 1) {
|
||||
DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
|
||||
} else { // set level
|
||||
gDebugLevel = atoi(argv[1]);
|
||||
if (gDebugLevel >= 0 && gDebugLevel < 11) {
|
||||
DebugPrintf("Debug level set to level %d\n", gDebugLevel);
|
||||
} else if (gDebugLevel < 0) {
|
||||
DebugPrintf("Debugging is now disabled\n");
|
||||
} else
|
||||
DebugPrintf("Not a valid debug level (0 - 10)\n");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) {
|
||||
const Common::DebugManager::DebugChannelList &debugLevels = DebugMan.listDebugChannels();
|
||||
|
||||
|
@ -193,6 +193,7 @@ protected:
|
||||
bool Cmd_Exit(int argc, const char **argv);
|
||||
bool Cmd_Help(int argc, const char **argv);
|
||||
bool Cmd_OpenLog(int argc, const char **argv);
|
||||
bool Cmd_DebugLevel(int argc, const char **argv);
|
||||
bool Cmd_DebugFlagsList(int argc, const char **argv);
|
||||
bool Cmd_DebugFlagEnable(int argc, const char **argv);
|
||||
bool Cmd_DebugFlagDisable(int argc, const char **argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user