Coverage report: /home/ellis/comp/core/lib/log/stream.lisp
Kind | Covered | All | % |
expression | 11 | 18 | 61.1 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; log/stream.lisp --- Logging streams
7
(defmacro with-log-stream ((stream-var destination &optional (lock (make-mutex :name "log-stream")))
9
"Bind STREAM-VAR to a regular logging stream for the duration of BODY.
11
DESTINATION may be either a pathname-designator, a symbol bound to an open
12
stream, or NIL if logging is ignored.
14
LOCK refers to the lock that should be held during the logging operation."
15
(once-only (destination)
19
(etypecase ,destination
21
(with-open-file (,stream-var ,destination
24
:if-does-not-exist :create
28
(let ((,stream-var ,destination))
31
(defmacro with-fast-log-stream ((stream-var destination &optional (lock (make-mutex :name "log-stream")))
33
"Bind STREAM-VAR to a 'fast' logging stream for the duration of BODY.
35
DESTINATION may be either a pathname-designator, a symbol bound to an open
36
stream, or NIL if logging is ignored.
38
LOCK refers to the lock that should be held during the logging operation."
39
(with-gensyms (binary-stream)
40
(once-only (destination)
44
(etypecase ,destination
46
(with-open-file (,binary-stream ,destination
49
:if-does-not-exist :create
51
(io/fast:with-fast-output (,stream-var ,binary-stream)
54
(io/fast:with-fast-output (,stream-var ,destination)