RSS Feed

Lisp Project of the Day

log4cl

You can support this project by donating at:

Donate using PatreonDonate using Liberapay

Or see the list of project sponsors.

log4cllogging

Documentation๐Ÿ˜€
Docstrings๐Ÿ˜€
Tests ๐Ÿคจ
Examples๐Ÿคจ
RepositoryActivity๐Ÿฅบ
CI ๐Ÿฅบ

This is the mystery why I didn't review any logging library so far! Probably, because there is a great article exists which compares 8 logging libraries.

Today I want only mention that my library of choice is log4cl. Mostly because if it's great integration with SLIME/SLY which helps when you have a lot's of "debug" logging in the app, but at some moment want to turn it on only for a function or a package.

Log4cl has great documentation which demonstrates all its features. Here I'll provide only a small example of its default logging output and ability to process additional arguments:

POFTHEDAY> (log:config :sane2 :debug)

POFTHEDAY> (defun foo (first-arg second-arg)
             (log:info "Entering into the foo with" first-arg "and" second-arg))

POFTHEDAY> (foo 100500 "Blah")

 <INFO> [21:04:10] poftheday (foo) -
  Entering into the foo with FIRST-ARG: 100500 and SECOND-ARG: "Blah" 

;; Now I want to process arguments with in format-like style:

POFTHEDAY> (defun foo (first-arg second-arg)
             (log:info "Entering into the (foo ~A ~A)" first-arg second-arg))

POFTHEDAY> (foo 100500 "Blah")
 <INFO> [21:04:53] poftheday (foo) - Entering into the (foo 100500 Blah)

Tomorrow I'll show you addons I've made, to make log4cl even more suitable for production applications.


Brought to you by 40Ants under Creative Commons License