image:stacklimit.png[Container limited to two columns]
///////////////////////////////////////////////////////////////////////////////
+[[shmlog]]
+
=== Enabling shared memory logging
As described in http://i3wm.org/docs/debugging.html, i3 can log to a shared
i3-msg shmlog $((50*1024*1024))
---------------
+=== Enabling debug logging
+
+The +debuglog+ command allows you to enable or disable debug logging at
+runtime. Debug logging is much more verbose than non-debug logging. This
+command does not activate shared memory logging (shmlog), and as such is most
+likely useful in combination with the above-described <<shmlog>> command.
+
+*Syntax*:
+------------------------
+debuglog <on|off|toggle>
+------------------------
+
+*Examples*:
+------------
+# Enable/disable logging
+bindsym $mod+x debuglog toggle
+------------
+
=== Reloading/Restarting/Exiting
You can make i3 reload its configuration file with +reload+. You can also
*/
void cmd_shmlog(I3_CMD, char *argument);
+/*
+ * Implementation of 'debuglog toggle|on|off'
+ *
+ */
+void cmd_debuglog(I3_CMD, char *argument);
+
#endif
*/
void close_logbuffer(void);
+/**
+ * Checks if debug logging is active.
+ *
+ */
+bool get_debug_logging(void);
+
/**
* Set debug logging.
*
'restart' -> call cmd_restart()
'reload' -> call cmd_reload()
'shmlog' -> SHMLOG
+ 'debuglog' -> DEBUGLOG
'border' -> BORDER
'layout' -> LAYOUT
'append_layout' -> APPEND_LAYOUT
argument = string
-> call cmd_shmlog($argument)
+# debuglog toggle|on|off
+state DEBUGLOG:
+ argument = 'toggle', 'on', 'off'
+ -> call cmd_debuglog($argument)
+
# border normal|none|1pixel|toggle|1pixel
state BORDER:
border_style = 'normal', 'pixel'
// 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);
+}
verbose = _verbose;
}
+/*
+ * Get debug logging.
+ *
+ */
+bool get_debug_logging(void) {
+ return debug_logging;
+}
+
/*
* Set debug logging.
*
################################################################################
is(parser_calls('unknown_literal'),
- "ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'resize', 'rename', 'nop', 'scratchpad', 'mode', 'bar'\n" .
+ "ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'resize', 'rename', 'nop', 'scratchpad', 'mode', 'bar'\n" .
"ERROR: Your command: unknown_literal\n" .
"ERROR: ^^^^^^^^^^^^^^^",
'error for unknown literal ok');