diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2007-10-02 10:35:35 +0200 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2007-10-02 10:35:35 +0200 |
commit | 3c31d317fa77b4f0f55b89fb07a63c65b3843cdf (patch) | |
tree | b70d0819f623a515fe5a926ded8b80d82ddd41ca | |
parent | 5cbb20a04c99113f485ac59124d2f1ffce3f59ee (diff) |
Add a debugging page.
darcs-hash:e4f4c096e3e20e6e8de59a4466e891fab8005a80
-rwxr-xr-x | journal.lisp | 23 | ||||
-rw-r--r-- | main.lisp | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/journal.lisp b/journal.lisp index 2ca1919..fa56b3f 100755 --- a/journal.lisp +++ b/journal.lisp @@ -288,7 +288,8 @@ ("Query" . ,*query*) ("Query string" . ,(http-get-query-string)) ("Subpath" . ,*subpath*) - ("Environment" . ,(http-get-env-vars))) + ("Environment" . ,(http-get-env-vars)) + #+clisp ("Environment #2" . ,(ext:getenv))) do (<:p (<:hr) (<:h2 (<:as-html x)) @@ -296,3 +297,23 @@ (<:pre (<:as-html (prin1-to-string y))))))) #.(restore-sql-reader-syntax-state)) + +(defun show-debugging-page () + (http-add-header "Content-Language" "de") + (http-send-headers "text/html; charset=UTF-8") + + (<xhtml :xmlns "http://www.w3.org/1999/xhtml" + :lang "de" + (when *debugging-p* + (loop for (x . y) in `(("Action" . ,*action*) + ("Request method" . ,*method*) + ("Query" . ,*query*) + ("Query string" . ,(http-get-query-string)) + ("Subpath" . ,*subpath*) + ("Environment" . ,(http-get-env-vars)) + #+clisp ("Environment #2" . ,(ext:getenv))) + do (<:p + (<:hr) + (<:h2 (<:as-html x)) + (<:p "Type " (<:em (<:as-html (type-of y))) ".") + (<:pre (<:as-html (prin1-to-string y)))))))) @@ -48,6 +48,7 @@ (*action* (or (keywordify (getf *query* :action)) (cond (*post-number* :view) ((string= "feed" (first *subpath*)) :view-atom-feed) + ((string= "debug" (first *subpath*)) :view-debugging-page) (t nil)))) (*method* (keywordify (gethash "REQUEST_METHOD" *http-env*))) (*script-filename* (pathname-as-file @@ -102,6 +103,7 @@ (update-records-from-instance entry))) (show-web-journal)) (:view-atom-feed (show-atom-feed)) + (:view-debugging-page (show-debugging-page)) (otherwise (show-web-journal))))))) |