What is Verbose?
Verbose is a logging framework for Common Lisp that aims to provide a good default setup as well as an extensible back-end to suit all your logging needs.
Verbose is a logging framework for Common Lisp that aims to provide a good default setup as well as an extensible back-end to suit all your logging needs.
Load Verbose with ASDF or Quicklisp.
(ql:quickload :verbose)
By default, a new logging thread is already started and set up with a REPL-Faucet on the INFO level, that simply prints log messages from the INFO level and above to the standard output:
(v:info :TEST "Hello world!")
Each logging statement expects a category and a format string. Optionally you can pass in format arguments:
(v:info :TEST "2+2=~f" (+ 2 2))
You can change the logging level of the REPL-Faucet easily:
(v:set-repl-level :DEBUG)
If you want to add a new Faucet, such as a rotating file log, you can use attach-to:
(v:attach-to :ERROR (make-instance 'rotating-log-faucet))
It should now write all log messages from :ERROR and above to a date-prepended log file in the current working directory. Have a look at the slots for rotating-log-faucet for finer control. You can also add a category filter:
(v:attach-to :ERROR (make-instance 'rotating-log-faucet) :category :TEST)
The *global-controller* is in itself a pipeline. You can therefore use all the tools from piping to customize even more.
Verbose is a sub-project of TyNETv5 ("Radiance"), licensed under the Artistic License 2.0 and ©2013 TymoonNET/NexT, Nicolas Hafner.
This program can be obtained via git on git://git.tymoon.eu/verbose.git. For questions, patches or suggestions, please contact me via email.
*GLOBAL-CONTROLLER*
*REPL-FAUCET-TIMESTAMP*
ATTACH-TO
(LEVEL PIPE &KEY CATEGORY FILTER (CONTROLLER *GLOBAL-CONTROLLER*))
CONTROLLER
Main controller class that holds the logging construct.
CRON-INTERVAL
A cron-like interval for rotations.
DEBUG
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
ERROR
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
FATAL
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
FORMAT-MESSAGE
(FAUCET MESSAGE)
Wrapper around pass to potentially be overwritten if the output format should be changed.
FORMAT-MESSAGE
((FAUCET ROTATING-LOG-FAUCET) (MESSAGE T))
FORMAT-MESSAGE
((FAUCET REPL-FAUCET) (MESSAGE T))
INFO
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
LOG
(LEVEL CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
MAKE-CRON-INTERVAL
(STRING)
MAKE-STANDARD-GLOBAL-CONTROLLER
()
REMOVE-GLOBAL-CONTROLLER
()
REPL-FAUCET
A simple logging faucet that prints log messages to the *standard-output*
ROTATE-LOG
(ROTATING-LOG-FAUCET)
Create a new log file.
ROTATE-LOG
((ROTATING-LOG-FAUCET ROTATING-LOG-FAUCET))
ROTATING-LOG-FAUCET
A file logger that rotates at the given (cron) interval.
SET-REPL-LEVEL
(LEVEL &KEY (FAUCET-NAME "REPL") (CONTROLLER *GLOBAL-CONTROLLER*))
SEVERE
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
TRACE
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)
UPDATE-INTERVAL
(ROTATING-LOG-FAUCET INTERVAL)
Change the rotation interval
UPDATE-INTERVAL
((ROTATING-LOG-FAUCET ROTATING-LOG-FAUCET) (INTERVAL CRON-INTERVAL))
WARN
(CATEGORY FORMAT-STRING &REST FORMAT-ARGS)