chalaev / cl-simple-logger

minimalistic Common Lisp logger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table of Contents

  1. The scope
  2. Prerequisites
  3. Quick start
    1. Create log directory
    2. Install the package
    3. Test in an SBCL session
  4. Packaging, compiling and testing
  5. Files
  6. License

Simple logging system for Common Lisp; currently works only on sbcl, see other-CLs.org.

The scope

  1. The logging system must be as simple and robust as a hammer.
  2. It must support multi-threading and (sometimes simultaneously) receive messages from different lisp programs (e.g., services on a web server).
  3. It should be simpler and shorter than any of the projects that would need a logging system.
  4. One should never suspect that bugs in his/her projects arise from the logging system.

Examples of other CL log systems: log4cl, cl-log.

Prerequisites

It is assumed that quicklisp is installed; emacs would help although it is not compulsory.

Quick start

Configure the log system before launching the log:

Create log directory

Under root privileges:

adduser shalaev staff
mkdir /var/log/sbcl
chgrp staff /var/log/sbcl
chmod 770 /var/log/sbcl

where shalaev should be replaced with your user name.

Install the package

Unpack simple-log.tbz into your Quicklisp directory:
tar xjfv simple-log.tbz --directory=$HOME/quicklisp/local-projects/

Test in an SBCL session

Open quick-start.lisp and evaluate it in an interactive SBCL session.

Packaging, compiling and testing

(Requires emacs.)

In Makefile,

  1. set SBCL to the path of the sbcl binary, and
  2. set quicklispDir to the directory where locally created server-log package will be stored; then
  3. make

The make command

  • compiles the test to the small (13mb) binary and copies it to the current directory, and
  • tests the code by running it in interpreting mode.

The compiled binary can be found in the generated/ directory.

Notes:

  1. Makefile requires
    1. emacs for generating the source code files in the generated/ directory from simple-log.org with the M-x org-babel-tangle command, and
    2. printangle function defined in lisp-goodies/dot.emacs file.
  2. Unless you have manually compiled sbcl with sh make.sh --with-sb-core-compression command, the resulting binary will be several times larger than 13mb.

Files

  1. README.org generates README.md for notabug and github.
  2. simple-log.org contains the code from generated/* together with explanations.
  3. Makefile is needed to test the changes made to the code; it
    1. uses emacs to generate the source code from the .org file,
    2. launches example.lisp in interpreting mode, and
    3. compiles example.lisp into generated/example.bin.
    4. creates simple-log.tbz
  4. other-CLs.org contains a note about making the code compatible with other CL dialects. (This does not seem to be hard.)
  5. helpers/* assist compilation.

License

This code is released under MIT license.

About

minimalistic Common Lisp logger


Languages

Language:Common Lisp 73.3%Language:Makefile 26.7%