parent
1fb6fa3de2
commit
c27fea0bef
|
@ -18,9 +18,10 @@
|
|||
|
||||
;; these options require a parameter passed
|
||||
(:name :logging
|
||||
:description "sets the log level. supported levels are info, debug, and error"
|
||||
:description (format nil "sets the log level. supported levels are: ~{~(~A~)~^, ~}"
|
||||
+valid-log-levels+)
|
||||
:long "log"
|
||||
:arg-parser #'set-logging-level
|
||||
:arg-parser #'identity
|
||||
:meta-var "LEVEL")
|
||||
(:name :load-file
|
||||
:description "loads specified lisp file before starting the server"
|
||||
|
|
12
lspx.lisp
12
lspx.lisp
|
@ -93,6 +93,18 @@ if we cannot find the file we throw an error"
|
|||
(defun main ()
|
||||
(multiple-value-bind (opts args) (get-opts)
|
||||
(declare (ignore args))
|
||||
|
||||
;; --log
|
||||
(when (getf opts :logging)
|
||||
(let ((keyw (car (member (intern (string-upcase (getf opts :logging))
|
||||
:keyword)
|
||||
+valid-log-levels+))))
|
||||
(if keyw
|
||||
(log:config keyw)
|
||||
(progn
|
||||
(format t "bad value for logging level specified.~%proper values are ~{~(~A~)~^, ~}~%"
|
||||
(mapcar #'string +valid-log-levels+))
|
||||
(uiop:quit 1)))))
|
||||
|
||||
;; -h/--help
|
||||
(when (getf opts :help)
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
|
||||
(declaim (inline static-asset-p generate-filepath set-logging-level))
|
||||
|
||||
(defun set-logging-level (level)
|
||||
"sets the log level for the app"
|
||||
(let ((keyw (intern (string-upcase level) :keyword)))
|
||||
(prog1 t
|
||||
(log:config (car (member keyw '(:info :debug :error)))))))
|
||||
(a:define-constant +valid-log-levels+
|
||||
'(:info :debug :error)
|
||||
:test 'equal)
|
||||
|
||||
(defmacro handle-user-abort (body &rest signal-forms)
|
||||
`(handler-case
|
||||
|
|
Loading…
Reference in New Issue