On 2010-03-17 17:51, Hans-Christoph Steiner wrote:
hey IOhannes,
Why generate verbosity levels on the fly? So far we've been using the syslog levels, I think we should stick with that and use that throughout.
so far nobody has been using "syslog" levels. i don't know when they entered the game.
however, the main reason to "generate on the fly" was, that i prefer to say "i want loglevels up to 7" rather than i want loglevels "1" and "2" and "3" and "4" and "5" and "6" and "7".
at a central point in the code i define a "maxverbosity". the code then generates menuitems for each loglevel. in the past there was a "maxverbosity"; and then there was a menu, where you could chose totally unrelated loglevels; code relying on maxverbosity (e.g. colouring code), would work only by chance with the loglevels selected by the menu. i prefer to change values in a single place. and i prefer to let computers do what they are better at than me (e.g. counting)
if "syslog" for you means you have loglevels 0..7, then go ahead and set maxverbosity to "7" and that's it.
if instead of system administration, you want to go with many programming frameworks (log4j and it's various clones like log4c, log4perl, log4..), set the maxverbosity to "5".
i agree that we should eventually agree on a common maxverbosity. but this should still be managed centrally, and not cluttered around the code.
fgamsdr IOhannes