diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-10-15 00:31:51 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-10-15 00:31:51 +0200 |
commit | 5635b5993744731f9456c671490a4702c45cd5d7 (patch) | |
tree | 4c36cf6ca1ab8223e8dd51bdd31ed9a9531fbfd3 /module/web/http | |
parent | Fix error propagation for some search queries. (diff) | |
download | calp-5635b5993744731f9456c671490a4702c45cd5d7.tar.gz calp-5635b5993744731f9456c671490a4702c45cd5d7.tar.xz |
Add rudementary server logging.
Diffstat (limited to '')
-rw-r--r-- | module/web/http/make-routes.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/module/web/http/make-routes.scm b/module/web/http/make-routes.scm index ab5f88a7..4fb5397a 100644 --- a/module/web/http/make-routes.scm +++ b/module/web/http/make-routes.scm @@ -71,6 +71,8 @@ (r:port ((@ (web request) request-port) request))) (let ((r:scheme ((@ (web uri) uri-scheme) r:uri)) (r:userinfo ((@ (web uri) uri-userinfo) r:uri)) + ;; TODO can sometimes be a pair of host and port + ;; '("localhost" . 8080). It shouldn't... (r:host (or ((@ (web uri) uri-host) r:uri) ((@ (web request) request-host) request))) @@ -80,6 +82,11 @@ (r:path ((@ (web uri) uri-path) r:uri)) (r:query ((@ (web uri) uri-query) r:uri)) (r:fragment ((@ (web uri) uri-fragment) r:uri))) + ;; TODO propper logging + (display (format #f "[~a] ~a ~a/~a?~a~%" + (datetime->string (current-datetime)) + r:method r:host r:path (or r:query "")) + (current-error-port)) (call-with-values (lambda () ((@ (ice-9 control) call/ec) |