[plt-scheme] #:log-format 'parenthesized-default
Some how I forgot the extend the contract when I added that keyword.
Stupid. I will commit a fix today.
Jay
On Mon, Jan 26, 2009 at 2:44 AM, Stephen De Gabrielle
<stephen at degabrielle.name> wrote:
> 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
> )
>
> -
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
--
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay
"The glory of God is Intelligence" - D&C 93