Log5 Reference Guide

The Log5 Manager

Dealing with Context

Senders

Starting, stopping and seeing

Using Log5 as a debugging tool

Categories

Output

Configuring Log5

At compile-time

At run-time (or load-time)

Getting at the guts

Indices

Index of Functions

Index of variables

Index of Macros

Full symbol index

The Log5 Manager

ignore-errors-p
function
If true, then log5 will ignore any errors that occur during logging actions. If false, log5 will enter the debugging. This is setfable.
log-manager
function
Returns the component that handles all of log5's bookkeeping.
output-specs
function
Returns a list of the current output specs in alphatetical order.
category-specs
function
Returns a list of the defined category specs in alphatetical order.
id->category id
function
Returns the category whose id is id (a number).

Dealing with Context

context
nil
No documentation found
pop-context
function
No documentation found
push-context context
function
No documentation found
with-context context &body body
macro
No documentation found
with-context-for category-spec context &body body
macro
No documentation found
log-message
nil
No documentation found
log-if predicate category-spec message &rest args
macro
No documentation found
log-for category-spec message &rest args
macro
No documentation found
when-logging category-spec &body body
macro
No documentation found

Senders

Starting, stopping and seeing

senders
function
Returns a list of the current senders.
start-sender name (sender-type &rest args) &key category-spec output-spec
macro

Create a log-message sender and add it to the list of active senders. Each sender has a name, a category-spec, an output-spec and a class (with optional initialization arguments). The name should be symbol and only one sender of any particular name can exist at a time.

The category-spec is a boolean combination of categories (see defcategory). A sender will send any message whose message-category satisfies the sender's category-spec.

The output-spec is a list of outputs defined with defoutput. You can also include strings and the special, predefined, outputs:

  • message - the text of the current log message
  • context - the contents of the current context (as a list)
  • category - the value of the category of the current message
start-stream-sender name location &key output-spec category-spec
macro
No documentation found
stop-sender name &key warn-if-not-found-p
macro
Find the sender named name and stop it. If the sender is not active, then a sender-not-found-warning will be signaled unless warn-if-not-found-p is set to nil.
stop-all-senders
function
Stops all logging.

Using Log5 as a debugging tool

debug-category-spec
nil
No documentation found
undebug-category-spec
nil
No documentation found

Categories

fatal error warn info trace dribble error+ warn+ info+ trace+ dribble+

defcategory name &optional category-spec documentation
macro

Define a category named name. This can be a simple category like

(defcategory :error)  
(defcategory prize-allocation) 

of a complex category like

(defcategory :bad-thing (or :error :warning :fatal))  
(defcategory non-file-foo (and (or foo bar biz) (not file-access))) 

Specifically, a simple category is just a name whereas a complex category is a boolean combination of other categories (either simple or complex). See category-specs if you want a list of defined categories.

Output

time category message

defoutput name form &key format static?
macro
Define an output specification: a link between a name and a form that will be called during logging to put something in the log file. You can specify a format string (as in a call to format) with the :format keyword argument. You can use the keyword :static? to indicate that the form's value will not change (e.g., the time of day is not static but the process id of the current Lisp is).

Configuring Log5

At compile-time

compile-category-spec
function
No documentation found

At run-time (or load-time)

configuration-file &key name type prefer-current-directory-p
function
Returns the path to the standard log5 configuration file. This is used by configure-from-file to setup logging activitiy. Configuration-file looks in the user's home directory (using user-homedir-pathname) and the directory specified by default-pathname-defaults. The default is to use a file named "logging.config" but you can use the :name and :type parameters to customize this. If files exist in both directories, the configuration-file will use the one in the home directory unless :prefer-current-directory-p` is true.
configure-from-file path &key stop-senders-first?
function
No documentation found

Getting at the guts

basic-sender
class
The root sender class from which all senders ~ should descend.
sender-with-categories
class
A sender that responds only to certain log categories.
stream-sender-mixin
class
No documentation found
stream-sender
class
No documentation found
location stream-sender-mixin
function
output-spec basic-sender
function
category-spec sender-with-categories
function
close-sender sender
function
close-stream? stream-sender-mixin
function
output-stream stream-sender-mixin
function
name bad-category-type-error
function
create-handle-message-context sender
function
start-handling sender
function
finish-handling sender
function

Indices

Index of Functions

Index of variables

Index of Macros

Full symbol index