Re: formal debug levels

From: Kinkie <kinkie-dev@dont-contact.us>
Date: Thu, 25 Oct 2007 10:35:55 +0200

On Wed, 2007-10-24 at 09:53 -0600, Alex Rousskov wrote:
> On Wed, 2007-10-24 at 23:45 +0800, Adrian Chadd wrote:
> > Syslog type levels come to mind. Have them as bit flags, so you can do
> > stuff like
> >
> > debug(DBG_HTTP_CLT, LVL_NOTIFY | LVL_CRITICAL) ("foo\n");
> >
> > That'd certainly make it easier for people writing/modifying code with
> > debugging statements; they'd know what the labels mean rather than guessing
> > at the numbers. :p
>
> I agree that names are better than magic numbers, both for sections and
> debug levels. However, naming constants is a minor issue, separate from
> how to define the levels.
>
> We could add bit flags for "dumps a lot of data" and perhaps "requires
> administrator attention" though. That may simplify the levels
> definition.

I agree to a point. Bitmasks have advantages (finer-grained filtering)
and disadvantages (less useable levels). The biggest challenge is IMO
managing to be consistent throughout the code-base.

        Kinkie
Received on Thu Oct 25 2007 - 02:36:04 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Oct 30 2007 - 13:00:03 MDT