Skip to content

Commit

Permalink
Log: remove unneeded type decl and add one for fn arg.
Browse files Browse the repository at this point in the history
SBCL now derives the return type correctly.
  • Loading branch information
sdilts committed Oct 15, 2023
1 parent af42c26 commit 2f0e74b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lisp/log.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@
;; be availabe at compile time:
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun get-log-level-data (level)
(the fixnum (ecase level
;; higher values mean less importance
(:trace (values 6 :white))
(:debug (values 5 :cyan))
(:info (values 4 :blue))
(:warn (values 3 :yellow))
(:error (values 2 :red))
(:fatal (values 1 :red))
(:ignore (values 0))))))
(declare (type debug-specifier level))
(ecase level
;; higher values mean less importance
(:trace (values 6 :white))
(:debug (values 5 :cyan))
(:info (values 4 :blue))
(:warn (values 3 :yellow))
(:error (values 2 :red))
(:fatal (values 1 :red))
(:ignore (values 0)))))

;; if you need to add more log levels, you may need to recompile, as
;; the level is translated to a number at read time. See log-string.
Expand Down

0 comments on commit 2f0e74b

Please sign in to comment.