diff --git a/util/util.lisp b/util/util.lisp index 95ad263..484cfab 100644 --- a/util/util.lisp +++ b/util/util.lisp @@ -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))