Coverage report: /home/ellis/comp/core/lib/log/pkg.lisp

KindCoveredAll%
expression01 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; log.lisp --- logging facades for lisp
2
 
3
 ;; this package contains logging facilities for lisp applications and libraries.
4
 
5
 ;;; Commentary:
6
 
7
 
8
 ;;; Simple Logging
9
 
10
 ;; The simple logging interface works as follows:
11
 
12
 ;; Use *LOG-LEVEL* to set the current level of logging. Value is
13
 ;; either a boolean or one of the following keywords: :warn :info
14
 ;; :debug :trace.
15
 
16
 ;; top-level macros: info! trace! warn! debug!
17
 
18
 ;; inspired by rust-lang/log https://crates.io/crates/log
19
 
20
 ;; the following shell environment variables may be queried by this
21
 ;; package:
22
 
23
 ;; - LOG_LEVEL : corresponds to a value for *LOG-LEVEL*. value may be
24
 ;; - empty or one of the following string values: WARN INFO DEBUG TRACE
25
 
26
 ;;; Advanced Logging
27
 
28
 ;; The advanced logging interface is based on Shinmera's VERBOSE which
29
 ;; implements basically all of the functionality we would expect in a logging
30
 ;; framework.
31
 
32
 ;; VERBOSE is built on top of another library from Shinmera's collection
33
 ;; called PIPING which provides a message-passing CLOS API. We have taken the
34
 ;; liberty to port over most of this functionality into a STD/PIPE package and
35
 ;; use it to build a logging framework using the same methodology.
36
 
37
 ;; In our case, the LOGGER class inherits from the STD/PIPE:PIPE class which
38
 ;; encapsulates one slot consisting of an array (the pipeline or PIPE) and
39
 ;; another slot providing an INDEX of cached lookup values into the array.
40
 
41
 ;; The LOGGER object is multi-threaded by default and handles marshalling of
42
 ;; MESSAGE objects through the ELEMENTs of the PIPE. A MESSAGE is handled by
43
 ;; each ELEMENT in the PIPE via the MSG method.
44
 
45
 ;; There are various ELEMENT implementations provided including level and tag
46
 ;; filters, condition handlers, as well as SINK elements which are responsible
47
 ;; for printing the final output of a MESSAGE to a stream or file.
48
 
49
 ;;; Code:
50
 (defpackage :log
51
   (:use :cl :std :std/meta :std/thread :time :db :config :ast :id :build :schema)
52
   (:export :*log-level* :*logger* :log-router
53
    :make-log-router :log-router-p
54
    :get-real-time-since :init-log-timestamp
55
    :*log-timestamp* :log-level-designator :log-timestamp-source :logger
56
    :logger-p :make-logger :log-error
57
    :define-log-level :log! :warn! :info! :debug! :trace! :fatal! :error!
58
    :log-p :warn-p :info-p :debug-p :trace-p :error-p :fatal-p
59
    :log-describe :warn-describe :info-describe :debug-describe :trace-describe :fatal-describe :error-describe
60
    :with-log-stream
61
    :with-fast-log-stream
62
    :*log-timestamp-format*
63
    :*log-indent*
64
    :log-message
65
    :level
66
    :simple-log-message
67
    :message-thread
68
    :*log-levels*
69
    :%log-object
70
    :log-object
71
    :rotating-file-sink
72
    :level-filter
73
    :tag-filter
74
    :tag-tree-filter
75
    :*tag-separator*
76
    :matching-tree-tag
77
    :restart-logger
78
    :remove-logger
79
    :default-logger
80
    :default-logger-config
81
    :with-logger
82
    :log-rotate
83
    :database-logger
84
    :db-sink
85
    :alien-logger
86
    :alien-source
87
    :alien-sink
88
    :ilevel
89
    :octets-to-log-message
90
    :log-message-to-octets
91
    :*log-show-backtrace*
92
    :log-pipe
93
    :log-config
94
    :*simple-log-message-formatter*
95
    :*log-message-class*
96
    :db-source
97
    :logger-config))