[olsr-dev] Re: Die "%m", die
Bernd Petrovitsch
(spam-protected)
Mon Jan 9 17:04:47 CET 2006
On Mon, 2006-01-09 at 16:12 +0100, Andreas Tønnesen wrote:
> > Features:
> > - several debug levels as specified now e.g. in the config file for
> > run-time selection.
> > Which number range BTW? The numbers should somewhat correlate with
> > the LOG_ERR levels of syslog() if we use that (and I don't know about
> > the Win view on that).
> > - a #define for compile-time "selection" of said levels.
> > - indepently selection of "print to stderr" and "syslog" it.
>
> Sounds fair enough. But should the debug level be a "level" like it is
> today, or rather a mask whare we can categorize the debug info better? The
Do we actually have categories that make sense?
> latter may become to complicated(user-wise) unless one is fairly strict
> with the allowed amount of flags. Still, it makes it easier for devs to
> request the exact output needed.
> And should there be a shared parameter for loglevel and debuglevel? IMO if
> we are to introduce a common function for logging to syslog and stderr we
> should be able to log to both in the same call. Wouldn't this be
ACK. I don't think it makes sens to have 3 parameters just to deduce
syslog-level, printf-level and a mask for categories since next to no
one will really understand it (and hey, that's just a tool within the
source and not a primary feature;-).
> problematic if debuglevel is shared with log levels?
That's the question. I wouldn't forget (or ignore) simplicity - both for
the admin/user choosing a debug value/mask and the developer which has
to decide on the level and/or bits in th mask for every single message.
To answer that question: IMHO "no". It is quite simple. And I usually in
my code, the log levels are to the syslog levels. On the first run, the
values are more or less random since they are development driven, but
once the code stabilized the messages are marked more for "maintenance"
use.
I would make one "log level" identical to syslog levels and these would
be compile- (one value or it becomes cumbersome) and run-time tunable -
perhaps different for "fprintf" and "syslog" - (let alone via syslog
config).
Categories (which do we actually have if we have them?) are ortogonal to
this.
Bernd
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services
More information about the Olsr-dev
mailing list