about summary refs log tree commit diff
path: root/exwm-core.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-core.el')
-rw-r--r--exwm-core.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/exwm-core.el b/exwm-core.el
index b0a683999da9..9e2829165ca6 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -40,19 +40,22 @@ Here are some predefined candidates:
 `exwm-debug-log-uptime': Display the uptime of this Emacs instance.
 `exwm-debug-log-time': Display time of day.
 `nil': Disable timestamp."
-  :group 'exwm
+  :group 'exwm-debug
   :type `(choice (const :tag "Emacs uptime" ,#'exwm-debug-log-uptime)
                  (const :tag "Time of day" ,#'exwm-debug-log-time)
                  (const :tag "Off" nil)
-                 (function :tag "Other")))
-
-(defun exwm-debug-log-uptime ()
-  "Add uptime to `exwm-debug' logs."
-  (emacs-uptime "[%.2h:%.2m:%.2s] "))
-
-(defun exwm-debug-log-time ()
-  "Add time of day to `exwm-debug' logs."
-  (format-time-string "[%T] "))
+                 (function :tag "Other"))
+  :set (lambda (symbol value)
+         (set-default symbol value)
+         ;; Also change the format for XELB to make logs consistent
+         ;; (as they share the same buffer).
+         (setq xcb-debug:log-time-function value)))
+
+(defalias 'exwm-debug-log-uptime 'xcb-debug:log-uptime
+  "Add uptime to `exwm-debug' logs.")
+
+(defalias 'exwm-debug-log-time 'xcb-debug:log-time
+  "Add time of day to `exwm-debug' logs.")
 
 (defvar exwm--connection nil "X connection.")