lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add log-levels (debug/progress/warn/error/none) to lilypond


From: Reinhold Kainhofer
Subject: [PATCH] Add log-levels (debug/progress/warn/error/none) to lilypond
Date: Fri, 29 Jul 2011 21:51:57 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.6.5; i686; ; )

(This patch is not fully tested, I'm running the regtests etc. right now!
I'm putting it up for discussion, nor for proper code/patch review.)

Proper loglevels: cmd-line option 
--loglevel=NONE/ERROR/WARN/PROGRESS/INFO/DEBUG

Allow the user to specify which messages (s)he wants to see on stderr:
The lilypond code basically stays the same, I only added a loglevel
global variable, which is used in the warning/error*/progress*/success
functions (ly:warning, ly:error, etc. in Scheme). If the proper level
is not set for a message, it is not printed.

There are only two larger changes:
-) Global var be_verbose_global replaced by loglevel (much finer-grained)
-) New functions (full)debug_output, which replaces code like:
   if (be_verbose_global) {
           progress_indication (...)
         }

That second change is the reason for the majority of code changes.

All changes were done to both warn.cc and to the members of the Input class
(apparently we have two parallel error-reporting "frameworks" in
lilypond...).

Note for all functions in warn.cc (not for the members of Input):
The debug_output function (and progress_indication and message) have
an optional argument to specify whether the output of the message
should always start on a new line or continue the previous output 
(progress by default continues, all others by default start a new
line).

Documentation for this new feature is still missing (both in the AU
as well as in the CG).

Please take a look:
http://codereview.appspot.com/4822055

As I said above, this patch works on the few files that I tested, but 
I have not yet had the time to run "make check" and "make doc" to detect
problems.

AFAICS, the default output of lilypond should not change at all (the regtests 
will probably show some small things that I have missed). But now you have the
chance to get only the warnings or errors without the progress messages.

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]