lilypond-devel
[Top][All Lists]
Advanced

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

Re: Proper loglevels: cmd-line option --loglevel=NONE/ERROR/WARN/PROGRES


From: Reinhold Kainhofer
Subject: Re: Proper loglevels: cmd-line option --loglevel=NONE/ERROR/WARN/PROGRESS/INFO/DEBUG (issue4822055)
Date: Sat, 30 Jul 2011 19:42:13 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; i686; ; )

Am Samstag, 30. Juli 2011, 18:28:32 schrieben Sie:
> overall commment: the parts that do the reporting should not need to
> know about the format of loglevel.

Which parts exactly do you mean? Those that call the error/message/warning 
functions, or the error/message/warning functions themselves?


> I think it would be better to have a
> 
>    if (log(ERROR))
>    {
>      ..
>    }

You mean in those few places where I need to use "if (loglevel & LOG_DEBUG)", 
because I can't call the debug_output function? That's a good idea to keep the 
internal structure of the loglevel only inside warn.cc and provide a helper 
function to access them.

> or perhaps even
> 
>    log(ERROR, "...")

Yes, that function is currently called non_fatal_error... Unfortunately, in 
some places there is additional code in the debug case (like creating the 
debug message as a string variable, or calling a different print function of 
an external library to print debug output). In these cases I need an if.

Or do you mean the "if (loglevel & ERROR)" checks inside the 
error/non_fatal_error/etc. function?
That would mean moving the logic whether to print a message or not to the 
print_message function, so it's centralized in just one spot. That also makes 
sense.

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]