provide tracing function util/lgx as debugging helper

This commit is contained in:
Helmut Merz 2025-05-26 09:03:39 +02:00
parent b9fa6efc68
commit 0c35d7bf97

View file

@ -4,7 +4,7 @@
(:use :common-lisp)
(:local-nicknames (:b64 :qbase64))
#+sbcl (:import-from :sb-ext #:add-package-local-nickname)
(:export #:make-vars-format #:lg #:lgd #:lgi #:lgw
(:export #:make-vars-format #:lg #:lgd #:lgi #:lgw #:lgx
#:from-unix-time #:to-unix-time
#:ptr
#:rfill #:rtrim
@ -32,7 +32,14 @@
(defmacro lgi (&rest vars) `(lg :info nil ,@vars))
(defmacro lgw (info &rest vars) `(lg :warn ,info ,@vars))
;;;; date and time manipulations
(defun lgx (op &key (stream t))
"trace invocation of op for debugging purposes"
(lambda (&rest args)
(let ((r (apply op args)))
(format stream "~&(~a ~a) = ~a~%" op args r)
r)))
;;;; date and time manipulations
(defconstant +unix-time-base+ (encode-universal-time 0 0 0 1 1 1970 0))