update with log

dev-stylish
Matthew Butterick 6 years ago
parent 38fc75c7a7
commit a313dacae4

@ -3,7 +3,7 @@
racket/list
sugar/define
"private/cache-utils.rkt"
"private/debug.rkt"
"private/log.rkt"
"setup.rkt")
;; The cache is a hash with paths as keys.

@ -8,6 +8,7 @@
racket/match
sugar/coerce
"file-utils.rkt"
"log.rkt"
"../setup.rkt"
"../render.rkt"
"../pagetree.rkt")
@ -30,17 +31,23 @@
(very-nice-path (car args)))))
(define (dispatch command-name)
(case command-name
[("test" "xyzzy") (handle-test)]
[(#f "help") (handle-help)]
[("start") (handle-start)] ; parses its own args
;; "second" arg is actually third in command line args, so use cddr not cdr
[("render") (handle-render)] ; render parses its own args from current-command-line-arguments
[("version") (handle-version)]
[("reset") (handle-reset (get-first-arg-or-current-dir))]
[("setup") (handle-setup (get-first-arg-or-current-dir))]
[("clone" "publish") (handle-publish)]
[else (handle-unknown command-name)]))
(with-logging-to-port
(current-error-port)
(λ ()
(case command-name
[("test" "xyzzy") (handle-test)]
[(#f "help") (handle-help)]
[("start") (handle-start)] ; parses its own args
;; "second" arg is actually third in command line args, so use cddr not cdr
[("render") (handle-render)] ; render parses its own args from current-command-line-arguments
[("version") (handle-version)]
[("reset") (handle-reset (get-first-arg-or-current-dir))]
[("setup") (handle-setup (get-first-arg-or-current-dir))]
[("clone" "publish") (handle-publish)]
[else (handle-unknown command-name)]))
#:logger pollen-logger
'info
'pollen))
(define (very-nice-path x)
(path->complete-path (simplify-path (cleanse-path (->path x)))))
@ -145,7 +152,7 @@ version print the version" (current-server-port) (make-publish-di
(parameterize ([current-project-root dir]
[current-server-port (or http-port (setup:project-server-port))]
[current-server-listen-ip (and localhost-wanted "127.0.0.1")])
(displayln "Starting project server ...")
(message "starting project server ...")
((dynamic-require 'pollen/private/project-server 'start-server) (format "/~a" (setup:main-pagetree dir)) launch-wanted)))
(define (make-publish-dir-name [project-root (current-directory)] [arg-command-name #f])

@ -6,7 +6,7 @@
sugar/list
"file-utils.rkt"
"cache-utils.rkt"
"debug.rkt")
"log.rkt")
(provide preheat-cache)
(define (path-cached? path)

@ -22,7 +22,7 @@
sugar/unstable/container
txexpr/base
"file-utils.rkt"
"debug.rkt"
"log.rkt"
"../pagetree.rkt"
"../cache.rkt")

@ -3,7 +3,7 @@
web-server/servlet-env
web-server/dispatch
"project-server-routes.rkt"
"debug.rkt"
"log.rkt"
"../setup.rkt"
"../file.rkt"
"../cache.rkt"
@ -20,13 +20,13 @@
[((string-arg) ... "out" (string-arg) ...) route-out]
[else route-default]))
(message (format "Welcome to Pollen ~a" pollen:version) (format "(Racket ~a)" (version)))
(message (format "Project root is ~a" (current-project-root)))
(message (format "welcome to Pollen ~a (Racket ~a)" pollen:version (version)))
(message (format "project root is ~a" (current-project-root)))
(define server-name (format "http://localhost:~a" (current-server-port)))
(message (format "Project server is ~a" server-name) "(Ctrl+C to exit)")
(message (format "Project dashboard is ~a/~a" server-name (setup:main-pagetree)))
(message "Ready to rock")
(message (format "project server is ~a (Ctrl+C to exit)" server-name))
(message (format "project dashboard is ~a/~a" server-name (setup:main-pagetree)))
(message "ready to rock")
(parameterize ([error-print-width 1000])
(serve/servlet pollen-servlet

@ -8,7 +8,7 @@
sugar/coerce
"private/file-utils.rkt"
"cache.rkt"
"private/debug.rkt"
"private/log.rkt"
"private/project.rkt"
"private/cache-utils.rkt"
"pagetree.rkt"
@ -215,7 +215,7 @@
(require (for-syntax racket/base)
pollen/private/include-template
pollen/cache
pollen/private/debug
pollen/private/log
pollen/pagetree
pollen/core)
DIRECTORY-REQUIRE-FILES

@ -10,7 +10,7 @@
rackjure/str
xml
(only-in html read-html-as-xml)
"../private/debug.rkt"
"../private/log.rkt"
"../private/splice.rkt")
(provide highlight make-highlight-css)

Loading…
Cancel
Save