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, reinh...@kainhofer.com, 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 _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel