set up logging in test-web
This commit is contained in:
parent
093509863a
commit
5ed409fe4a
5 changed files with 11 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
|||
test.db
|
||||
bin
|
||||
log
|
||||
.env
|
||||
*-test.log
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
(defun setup-services (&optional (cfg config:*root*))
|
||||
(setf *root* (make-instance 'context :config cfg))
|
||||
(dolist (c (config:children cfg))
|
||||
(dolist (c (reverse (config:children cfg)))
|
||||
(add-service *root* c)))
|
||||
|
||||
(defun shutdown ()
|
||||
|
@ -74,6 +74,7 @@
|
|||
(actions ctx)))))
|
||||
|
||||
(defun add-service (ctx cfg)
|
||||
(format t "~&add-service: ~s~%" (config:name cfg))
|
||||
(with-slots (services) ctx
|
||||
(let ((child (funcall (config:setup cfg) cfg)))
|
||||
(when child
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
|
||||
(config:root :env-keys '(:address :port))
|
||||
|
||||
(config:add :logger :class 'logging:config
|
||||
:loglevel :info
|
||||
:logfile (t:test-path "scopes-test.log" "log")
|
||||
:console nil)
|
||||
|
||||
(config:add :server :class 'server:config
|
||||
:port "8899"
|
||||
:routes
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
(:local-nicknames (:config :scopes/config)
|
||||
(:core :scopes/core)
|
||||
(:client :scopes/web/client)
|
||||
(:logging :scopes/logging)
|
||||
(:message :scopes/core/message)
|
||||
(:server :scopes/web/server)
|
||||
(:t :scopes/testing))
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
:port (parse-integer (port cfg))
|
||||
:address (address cfg)
|
||||
;:server :woo
|
||||
:silent t))))
|
||||
:silent t))
|
||||
(log:info "server started on port ~s." (port cfg))))
|
||||
|
||||
(defun stop (ctx)
|
||||
(clack:stop (listener ctx)))
|
||||
|
|
Loading…
Add table
Reference in a new issue