Vom - A tiny logging library for Common Lisp
Vom is a logging library for lisp. It's goal is to be useful and small. It does not provide a lot of features as other loggers do, but has a small codebase that's easy to understand and use.
Logging is done by calling one of the logging macros:
Each of these is a macro defined as such:
(defmacro notice (format-str &rest args) ...)
They are used almost exactly like
format (but without specifying the stream):
(vom:error "there was a problem setting up your database: ~a" error)
You can set a global logging level:
;; set the default loglevel such that only errors (or higher) get logged (vom:config t :error)
or you can set per-package loglevels:
(vom:config :my-package :notice)
In the above examples, any unconfigured package will have the loglevel of
:error, but the package
my-package will log anything that's a
:notice or above.
The stream that vom logs to by default. This defaults to
This is a function of 3 arguments that takes a log level, a package keyword name, and that package's configured log level and returns one or more streams as multiple values that the log entry will be logged to:
;; example: this hook logs the request to multiple streams if we're getting a ;; log entry from the "particle-accelerator" package (setf vom:*log-hook* (lambda (level package package-level) (declare (ignore level package-level)) (if (eq package :particle-accelerator) (values t *my-file-log-stream* *another-stream*) t)))
MIT. Do what you want with it. Just give me credit. Or I'll come to your house for two weeks and eat your food and sleep on your couch and use your toothbrush.
- Andrew Danger Lyon <email@example.com>