On Mon, Sep 01, 2008 at 01:31:57PM +0200, H.Merijn Brand wrote:
> On Sun, 31 Aug 2008 23:56:43 +0100, Tim Bunce <[EMAIL PROTECTED]>
> wrote:
> 
> > Having said all that, I can see some value in having a separate driver
> > trace level. I suggest a few of the "middle 16 bits" are given over to
> 
> IMHO 4 bits will do (0..15). If that is correct, I'll also change the
> levels to leave the basic levels 1 and 2 alone.

Actually I'd rather squeeze the levels concept down to 0..7 for both DBI
and DBD levels in order to make two more flag bits available and to
encourage greater use of flags.

(I see that the DBD::Unify release doesn't use levels above 5.
The few high levels used in the DBI should be flags anyway.)

> To be backward compatible, there should also be a flag that tells me to
> ignore the DBI level if DBD level has been set (even to 0).

I don't see a great need to be backward compatible here.

> Currently the drivers will use the DBI level as shotgun method (as you
> call it), but what if the end-user is interested in DBI-only messages,
> and selects "3,0" specifically asking DBI-only at level 3, but keep
> silent about DBD.
> 
> > that purpose. The "user interface" for setting the value could be as
> > simple as setting a negative trace level. For example:
> > 
> >     $h->trace("1,-2"); # DBI trace level 1, DBD trace level 2
> 
> Why the minus?

So parse_trace_flags() knows that the integer value should be assigned
to the DBD trace level and not the DBI trace level.

> As the sep char has never been documented before, this is the time to
> give it intuitive meaning.

The sep char is documented:
http://search.cpan.org/~timb/DBI-1.607/DBI.pm#Enabling_Trace

> Simplest suggestion could be to separate DBI and DBD flags with a
> semicolon, where empty parts will not change the current state
> [...] but I might be wandering into lalaland here

I suspect so. I don't see any need to change parse_trace_flags() beyond
handling negative numbers as DBD trace level.

I think we can should the KISS principle as far as possible here.

Tim.

Reply via email to