diff options
author | Colin Okay <cbeok@protonmail.com> | 2020-05-09 21:29:17 -0500 |
---|---|---|
committer | Colin Okay <cbeok@protonmail.com> | 2020-05-09 21:29:17 -0500 |
commit | 8c120d41f1a202105175503629aa79b2808421d2 (patch) | |
tree | 67582b5193a13c8d2faf554177d2558bba0d9f7e /lazybones.lisp | |
parent | 22dd2e7c2614092287f05305a0d9367751ba85f3 (diff) |
added logging switch and stream
Diffstat (limited to 'lazybones.lisp')
-rw-r--r-- | lazybones.lisp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lazybones.lisp b/lazybones.lisp index 318ae95..92f6d93 100644 --- a/lazybones.lisp +++ b/lazybones.lisp @@ -20,6 +20,12 @@ If no known decoder matches, holds a stream. Bound by route handlers for POST, PUT, and PATCH requests.") +(defvar *logging-p* nil + "Set to T if you want ot log requests to the value of *logging-stream*.") + +(defvar *logging-stream* t + "Set to T (i.e the standard output) by default.") + (defvar *resp-headers* nil "A PLIST bound at the beginning of every response. Can be used to add additional headers to responses valid responses.") @@ -260,6 +266,8 @@ for the request's path." (defun main-handler (req) + (when *logging-p* + (format *logging-stream* "~a~%" req)) (handler-case (multiple-value-bind (args handler) (lookup-route req) (if handler |