[plt-scheme] #:log-format 'parenthesized-default
Hi,
I think I'm missing a trick:
I'm using serve/servlet with
#:log-file (build-path (current-directory) (string->path
(string-append "thread-" (get-date))))
and #:log-format 'parenthesized-default
but it brings up an error 'does not expect an argument with keyword
#:log-format'
This seems odd, as excluding the argument returns the error
'application: missing argument expression after keyword in:
#:log-format'
* Adding a require for web-server/dispatchers/dispatch-log seemed to
have no effect.
* I believe the argument is correct as per
http://docs.plt-scheme.org/web-server/servlet-env_ss.html
I think I've probably missed something simple - any suggestions?
Thanks,
Stephen
-a working example-
#lang scheme
(require web-server/servlet
web-server/templates
web-server/dispatchers/dispatch-log
scheme/date
)
(provide/contract (start (request? . -> . response?)))
(define (logfile-path)
(build-path (current-directory) (string->path (string-append "thread-"
(number->string (date-year (seconds->date (current-seconds)))) "-"
(number->string (date-month (seconds->date (current-seconds)))) "-"
(number->string (date-day (seconds->date (current-seconds)))) "_"
(number->string (date-hour (seconds->date (current-seconds)))) "-"
(number->string (date-minute (seconds->date (current-seconds)))) "-"
(number->string (date-second (seconds->date (current-seconds))))
".log"
))))
(define (start request)
`(html (head (title "Hello world!"))
(body (p "Hey out there!"))))
(require web-server/servlet-env)
(serve/servlet start
#:launch-browser? #t
#:quit? #f
#:listen-ip #f
#:port 8000
#:extra-files-paths
(list (current-directory))
#:servlet-path "/threads-vi.ss"
#:mime-types-path "data/mime.types"
#:log-file (logfile-path)
#:log-format 'parenthesized-default
)
;---
-MY code-
#lang scheme
;#lang web-server/insta
(require web-server/servlet
web-server/templates
web-server/dispatchers/dispatch-log
scheme/gui ;
xml
net/sendurl
scheme/date
"standard-requires.ss"
)
(provide/contract (start (request? . -> . response?)))
[...]
(require web-server/servlet-env)
(serve/servlet start
#:launch-browser? #t
#:quit? #f
#:listen-ip #f
#:port 8000
#:extra-files-paths
(list (current-directory))
#:servlet-path "/threads-vi.ss"
#:mime-types-path "data/mime.types"
#:log-file (build-path (current-directory)
(string->path (string-append "thread-" (get-date))))
#:log-format 'parenthesized-default
)
-