I'm back from vacation and have just read through this thread. I'm not sure I've followed it all, but here's a proposal from me that may refocus the discussion.
Current situation: The internal DBIc_TRACE_SETTINGS(imp_xxh) value is a 32 bit int. The lowest 8 bits are used for TraceLevel 0..15. The middle 16 bits are reserved for DBI trace flags (effectively unused). The highest 8 bits are reserved for drivers. There's a DBIc_TRACE(imp, flags, flaglevel, level) macro documented as: DBIc_TRACE: true if flags match & DBI level>=flaglevel, or if DBI level > level. This is the main trace testing macro to be used by drivers. (Drivers should define their own DBDtf_* macros for the top 8 bits: 0xFF000000) Examples: DBIc_TRACE(imp, 0, 0, 4) = if level >= 4 DBIc_TRACE(imp, DBDtf_FOO, 2, 4) = if tracing DBDtf_FOO & level>=2 or level>=4 DBIc_TRACE(imp, DBDtf_FOO, 2, 0) = as above but never trace just due to level though I think few drivers use this DBIc_TRACE macro. The DBI itself should use it but doesn't, simply due to lack of effort. Desire: As I understand it, the principle desire is for an additional 'trace level' dedicated for driver use. I'd argue that the need for a separate trace level would be greatly reduced if the current DBI trace output could be more finely controlled. We should move away from using the 'shotgun' trace level to using named trace flags to specify exactly what we're interested in. Names can also be given to groups of flags so common sets of flags are easy to use. That'll require much greater use of the DBIc_TRACE macro. 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 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 Tim. p.s. re the separator for the trace values... the code is currently for my $word (split /\s*[|&,]\s*/, $spec) { ... } (see parse_trace_flags() in DBI.pm) but there's nothing magical about those characters. To emphasize that, it should perhaps be changed to: /\s*[-\W]\s*/ but that might limit any magic we may wish to add in future.