10.6 Warnings, Errors, Progress and Debug Output

Available log levels

LilyPond has several log levels to specify how verbose the output on the console should be, as shown in the following table. Note that only the first few characters of a given value are checked (as indicated); additionally, case doesn’t matter. In other words, ERR is the same as error or ERRO, for example.

NONE

no output at all, even on failure

ERR[OR]

only error messages

WARN

only error messages and warnings

BASIC

warnings, errors, and basic progress (success, etc.)

PROG[RESS]

warnings, errors, and full progress messages

INFO

warnings, errors, progress, and more detailed information (default)

DEBUG

all messages, including full debug messages (very verbose!)

The log level can either be set with the environment variable LILYPOND_LOGLEVEL or on the command line with the --loglevel=... option.

Functions for debug and log output

LilyPond has two different types of error and log functions:

There are also Scheme functions to access all of these logging functions from scheme. In addition, the Grob class contains some convenience wrappers for even easier access to these functions.

The message and debug functions in file warn.hh also have an optional argument newline to specify whether the message should always start on a new line or continue a previous message. They also do not have a particular input position associated, so there are no progress functions in the Input class. By default, function progress_indication() does not start on a new line but rather continues the previous output. All other functions by default start their output on a new line.

LilyPond’s error functions come in three different flavors: fatal error messages, programming error messages, and normal error messages.

If the Scheme option warning-as-error is set, any warning is treated as if Input::error() was called.

All logging functions at a glance

C++, no locationC++, from input location
ERRORerror (), programming_error (msg), non_fatal_error (msg)Input::error (msg), Input::programming_error (msg)
WARNwarning (msg)Input::warning (msg)
BASICbasic_progress (msg)
PROGRESSprogress_indication (msg)
INFOmessage (msg)Input::message (msg)
DEBUGdebug_output (msg)Input::debug_output (msg)
C++, from a GrobScheme, music expression
ERRORGrob::programming_error (msg)
WARNGrob::warning (msg)(ly:music-warning music msg)
BASIC
PROGRESS
INFO(ly:music-message music msg)
DEBUG
Scheme, no locationScheme, input location
ERROR(ly:error msg args), (ly:programming-error msg args)
WARN(ly:warning msg args)(ly:input-warning input msg args)
BASIC(ly:basic-progress msg args)
PROGRESS(ly:progress msg args)
INFO(ly:message msg args)(ly:input-message input msg args)
DEBUG(ly:debug msg args)

LilyPond Contributor’s Guide v2.25.32 (development-branch).