Implement debuglog command
Add debuglog command that takes toggle|on|off. Add get_debug_logging() to be able to toggle. Make t/187-commands-parser.t expect 'debuglog'. Document the debuglog command in userguide.
This commit is contained in:
committed by
Michael Stapelberg
parent
6241419c86
commit
023594909e
@ -2059,3 +2059,23 @@ void cmd_shmlog(I3_CMD, char *argument) {
|
||||
// XXX: default reply for now, make this a better reply
|
||||
ysuccess(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of 'debuglog toggle|on|off'
|
||||
*
|
||||
*/
|
||||
void cmd_debuglog(I3_CMD, char *argument) {
|
||||
bool logging = get_debug_logging();
|
||||
if (!strcmp(argument,"toggle")) {
|
||||
LOG("%s debug logging\n", logging ? "Disabling" : "Enabling");
|
||||
set_debug_logging(!logging);
|
||||
} else if (!strcmp(argument, "on") && !logging) {
|
||||
LOG("Enabling debug logging\n");
|
||||
set_debug_logging(true);
|
||||
} else if (!strcmp(argument, "off") && logging) {
|
||||
LOG("Disabling debug logging\n");
|
||||
set_debug_logging(false);
|
||||
}
|
||||
// XXX: default reply for now, make this a better reply
|
||||
ysuccess(true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user