set up logging in test-web

This commit is contained in:
Helmut Merz 2024-07-04 06:57:48 +02:00
parent 093509863a
commit 5ed409fe4a
5 changed files with 11 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
test.db
bin
log
.env
*-test.log

View file

@ -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

View file

@ -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

View file

@ -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))

View file

@ -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)))