emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/rt-liberation 96cc027 04/72: * rt-liberation.el: Add a


From: Stefan Monnier
Subject: [elpa] externals/rt-liberation 96cc027 04/72: * rt-liberation.el: Add a debug option.
Date: Wed, 5 Aug 2020 11:57:32 -0400 (EDT)

branch: externals/rt-liberation
commit 96cc027f2b6893ba67848a51f502230237c3624a
Author: Johnathan Rabkin <yonirabkin@member.fsf.org>
Commit: Johnathan Rabkin <yonirabkin@member.fsf.org>

    * rt-liberation.el: Add a debug option.
---
 rt-liberation.el | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/rt-liberation.el b/rt-liberation.el
index b75bebd..3b4cd7a 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -179,6 +179,28 @@ The custom field symbols provide the programmer with a 
consistent
 way of referring to certain custom fields. The custom field
 strings are the server specific strings.")
 
+(defvar rt-liber-debug-log-enable nil
+  "If t then enable logging of communication to a buffer.
+
+Careful! This might create a sizable buffer.")
+
+(defvar rt-liber-debug-log-buffer-name "*rt-liber debug log*"
+  "Name of debug log buffer.")
+
+
+;;; --------------------------------------------------------
+;;; Debug log
+;;; --------------------------------------------------------
+
+(defun rt-liber-debug-log-write (str)
+  "Write STR to debug log."
+  (when (not (stringp str))
+    (error "must be a string"))
+  (with-current-buffer (get-buffer-create
+                       rt-liber-debug-log-buffer-name)
+    (goto-char (point-max))
+    (insert str)))
+
 
 ;;; --------------------------------------------------------
 ;;; TicketSQL compiler
@@ -314,6 +336,9 @@ AFTER  date after predicate."
   (with-temp-buffer
     (insert answer-string)
     (goto-char (point-min))
+    (when rt-liber-debug-log-enable
+      (rt-liber-debug-log-write (buffer-substring (point-min)
+                                                 (point-max))))
     (funcall parser-f)))
 
 



reply via email to

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