-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
elaiza-utils.el
32 lines (29 loc) · 919 Bytes
/
elaiza-utils.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;;; elaiza-utils.el --- Common utilities for ELAIZA -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2024 Alessandro Wollek
;;
;; Author: Alessandro Wollek <[email protected]>
;; Homepage: https://github.com/SFTtech/emacs-elaiza
;; SPDX-License-Identifier: GPL-3.0-only
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;; Common utilities for ELAIZA
;;
;;; Code:
(defcustom elaiza-debug nil
"Log for debugging purposes to *elaiza log*.
For debugging network connections set variable `url-debug' to non-nil."
:group 'elaiza
:type 'boolean)
(defun elaiza-debug (tag &rest args)
"Append TAG -> ARGS to *elaiza-log* if `elaiza-debug' is non-nil."
(when elaiza-debug
(with-current-buffer (get-buffer-create "*elaiza-log*")
(save-excursion
(goto-char (point-max))
(insert (symbol-name tag) " -> " (apply #'format args) "\n")))))
(provide 'elaiza-utils)
;;; elaiza-utils.el ends here