diff --git a/.gitignore b/.gitignore index 201cdac..cb3c359 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ test.db bin +log .env -*-test.log diff --git a/core/core.lisp b/core/core.lisp index 492c244..d0b97f7 100644 --- a/core/core.lisp +++ b/core/core.lisp @@ -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 diff --git a/test/etc/config-web.lisp b/test/etc/config-web.lisp index 0acbe57..71695f2 100644 --- a/test/etc/config-web.lisp +++ b/test/etc/config-web.lisp @@ -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 diff --git a/test/test-web.lisp b/test/test-web.lisp index 5697a0c..9dae2ec 100644 --- a/test/test-web.lisp +++ b/test/test-web.lisp @@ -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)) diff --git a/web/server.lisp b/web/server.lisp index 38e26e8..3546732 100644 --- a/web/server.lisp +++ b/web/server.lisp @@ -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)))