[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm 16d643d 1/2: Fix timestamp for debug logs

From: Chris Feng
Subject: [elpa] externals/exwm 16d643d 1/2: Fix timestamp for debug logs
Date: Sun, 15 Sep 2019 09:40:07 -0400 (EDT)

branch: externals/exwm
commit 16d643dd3b2b8e468dbbfb2ad03d7abe41fdf94d
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Fix timestamp for debug logs
    * exwm-core.el (exwm-debug-log-time-function): Moved to `exwm-debug'
    group and set `xcb-debug:log-time-function' automatically.
    (exwm-debug-log-uptime, exwm-debug-log-time): Reuse the definition
    from XELB.
 exwm-core.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/exwm-core.el b/exwm-core.el
index b0a6839..9e28291 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.")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]