Martin Buchmann
Martin Buchmann

Reputation: 1231

Logging of debugging and other infos during development

I used the dbg macro from Peter Norvig's PAIP in the past to output intermediate and debugging information during development. I found several logging libraries for more sophisticated applications and am wondering what other people use.

How do you organize the output of intermediate information during development and debugging?

Upvotes: 0

Views: 55

Answers (1)

Ehvince
Ehvince

Reputation: 18395

I use the de-facto logging library log4cl (now maintained by the community on https://github.com/sharplispers/log4cl/).

https://lispcookbook.github.io/cl-cookbook/debugging.html#logging

Its simplest use is like this:

(log:info *foo*)

but we can also interleave format control structures:

(log:info "the variable ~a is ~{~a~}" *foo*)

When we install its companion library log4slime in Emacs, we get a menu and mouse clicks to filter the output. For example, if you have a bunch of info logs and some warnings, and you want to see only the warnings, you can do that. You can act on this globally, per package, per function, and by CLOS methods and CLOS hierarchy (before and after methods).

traceing can be useful sometimes.

Upvotes: 4

Related Questions