Function: apheleia--log
apheleia--log is a natively compiled function defined in
apheleia-log.el.
Signature
(apheleia--log CATEGORY MESSAGE &rest ARGS)
Documentation
Log diagnostic message to apheleia-debug-info-buffer.
If apheleia-log-debug-info is nil, this does nothing. CATEGORY
is a symbol that can help in filtering the resulting log output.
MESSAGE and ARGS are interpreted as in message, except that any
of ARGS can also be a function of no arguments which will be
invoked to get the real value. This is helpful because the
function won't be evaluated if logging is disabled. Only lambda
functions are accepted, to avoid symbols being interpreted as
callables by accident.
Source Code
;; Defined in /nix/store/lwcwryzabcmvjcwwzzs65jrwf7p7d7cs-emacs-packages-deps/share/emacs/site-lisp/elpa/apheleia-20260915.1628/apheleia-log.el
;; Cribbed this from myself in straight.el
(defun apheleia--log (category message &rest args)
"Log diagnostic message to `apheleia-debug-info-buffer'.
If `apheleia-log-debug-info' is nil, this does nothing. CATEGORY
is a symbol that can help in filtering the resulting log output.
MESSAGE and ARGS are interpreted as in `message', except that any
of ARGS can also be a function of no arguments which will be
invoked to get the real value. This is helpful because the
function won't be evaluated if logging is disabled. Only lambda
functions are accepted, to avoid symbols being interpreted as
callables by accident."
(when apheleia-log-debug-info
(with-current-buffer (get-buffer-create apheleia-debug-info-buffer)
(unless (derived-mode-p 'special-mode) (special-mode))
(save-excursion
(goto-char (point-max))
(let ((inhibit-read-only t)
(body nil))
(condition-case err
(let ((args (mapcar
(lambda (arg)
(if (and (listp arg)
(functionp arg))
(funcall arg)
arg))
args)))
(setq body (apply #'format message args)))
(error (setq body (format "Got error formatting log line %S: %s"
message
(error-message-string err)))))
(let ((msg
(format
"%s <%S>: %s"
(format-time-string "%Y-%m-%d %H:%M:%S.%3N" (current-time))
category body)))
(insert msg "\n")
(when noninteractive
(message "%s" msg))))))))