Skip to content
Urs Liska edited this page Mar 24, 2015 · 2 revisions

openLilyLib Common Logging Functionality

openLilyLib provides a set of logging commands that are primarily intended for library developers but that can also be used by end users. The commands

  • oll:debug
  • oll:log
  • oll:warn
  • oll:error

produce respective console messages. Please note that oll:error will abort the compilation completely, so please use it only if you are convinced that the error condition is so severe that the compilation won't produce any usable results.

When a message is triggered for the first time a log file will be opened beside the compiled file, with the name $BASENAME.oll.log. This contains the openLilyLib-related log messages.

The commands take two or three arguments: an optional location, a format string, and a value. If the first argument is a location a clickable console message is produced, otherwise it will be a simple text message. The format string and substitution value follows Scheme's (format) syntax.

% Example
#(oll:warn "This is not an option: ~a" data)

data is a Scheme variable defined before. Usually these logging functions are used within Scheme functions but it can of course be used to produce logging information about general LilyPond macros.

The output produced by logging commands can be limited through the configuration interface by setting

\setOption global.loglevel <log-level>

with <log-level> being one of

  • #oll-loglevel-debug
  • #oll-loglevel-log
  • #oll-loglevel-warning
  • #oll-loglevel-critical
  • #oll-loglevel-nolog

Don't forget the hash sign before the constant's name, otherwise you'd store the name of the constant.