On Sat, Jul 30, 2011 at 2:42 PM, Reinhold Kainhofer <reinh...@kainhofer.com> wrote: > 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?
What I mean is that the callers should tag their messages with the type of the message, and let the logging framework decide whether to print it or not. There are some tiny performance optimizations, like - if (be_verbose_global) + if (loglevel & LOG_DEBUG) { string spaces = ""; for (size_t i = 0; i < state_stack_.size (); i++) spaces += " "; - progress_indication (string ("\n") + spaces + string ("[") + file->name_string ()); + debug_output (spaces + string ("[") + file->name_string ()); } you could just drop the if in this case. > 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. yep. > Yes, that function is currently called non_fatal_error... Unfortunately, in Also, in lilypond, the difference between (non_fatal) error and warning never has been very clear. Maybe we should just have a fatal("..") // exits and error("..") // does not exit, but sets return status = 1 warning("..") // prints, succesful exist status. -- Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel