On Sat, 30 Jun 2001, Stas Bekman wrote:

> modperl_trace_level_set gets called from modperl_cmd.c only if you have
> PerlTrace in httpd.conf. Of course this case ignores the env var, but
> there is no other place in the code that calls this func to check for the
> env setting of MOD_PERL_TRACE.

right, because we have PerlTrace now.  not that we can't support
MOD_PERL_TRACE too.
 
> On the related note the following would be very useful when debugging
> configuration sections and possibly from the code as well, if we provide a
> hook to change the trace level from code as well:
>   $s->trace_level('d');

that would be useful.  though at runtime with threaded mpm, it is not
threadsafe.  but we could make a per-request trace level that overrides
the per-server.
 
> Now what would be nice to have is to allow the negation of the level, so
> in httpd.conf one can do:
> 
>   PerlTrace d
>   PerlModule CGI
>   PerlTrace !d
> 
> Here I want to have a 'd' trace only for a section between two PerlTrace
> directives.

'PerlTrace !d' looks like it should remove 'd' tracing.  if you only want
'd', then use 'PerlTrace d'

> I think also that this can be improved as well: Currently
> 
>   PerlTrace d
> 
> followed by
> 
>   PerlTrace g
> 
> turns off 'd' and turns on 'g' instead of appending 'g'.

why not just use 'PerlTrace dg' then?

> To summarize I suggest to have:
> 
> PerlTrace [!]all | [!]d[!]f[!]g[!]h[!]i[!]m[!]s | off
> 
>   all turn all on
>   off turn all off
>   d   directive processing
>   f   filters
>   g   Perl runtime interaction
>   h   handlers
>   i   interpreter pool management
>   m   memory allocations
>   s   perl sections
> 
> !, before the letter, turns off the setting for this level, so one can
> have:
> 
>   PerlTrace dh       #level = dh
>   PerlTrace !dg!h    #level = g

i'm not seeing how this is useful, why wouldn't you just say 'PerlTrace g'? 
 
> well if we have !, we can also do: !all (instead of adding 'off' level).

why not just stick with 'off' ?

> (but if we have off would be nice to replace all with on (or alias) but I
> understand that it'll break the convention with normal Perl tracing)

an alias would be fine i guess.
 
> and of course being able to turn levels on and off via $server.

how about something similar to Perl's $^D?
then you can do:

local $ModPerl::Trace = 1|4; #dg

or

local $ModPerl::Trace &= ~4; #remove 'g'

or

local $ModPerl::Trace |= 4; #append 'g'

there could be constants for the numbers.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to