On Mar 17, 2010, at 1:29 PM, IOhannes m zmoelnig wrote:

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.


This sounds a lot more complicated without much real gain. How about just emulating syslog? Its a tried true way to do it, and it is already widely understood and documented.

        - messages post at log levels 0-7
        - the menu item sets the "all levels up to X"
        - the messages are tagged with level to be optionally colorized

.hc

----------------------------------------------------------------------------

If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of everyone, and the receiver cannot dispossess himself of it. - Thomas Jefferson



_______________________________________________
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev

Reply via email to