perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: modperl-docs/src/docs/general/testing testing.pod
Date Wed, 21 Jan 2004 22:18:53 GMT
stas        2004/01/21 14:18:53

  Modified:    src/docs/general/testing testing.pod
  extend the notes on Apache::TestTrace
  Revision  Changes    Path
  1.31      +51 -4     modperl-docs/src/docs/general/testing/testing.pod
  Index: testing.pod
  RCS file: /home/cvs/modperl-docs/src/docs/general/testing/testing.pod,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -u -r1.30 -r1.31
  --- testing.pod	18 Jan 2004 08:41:15 -0000	1.30
  +++ testing.pod	21 Jan 2004 22:18:53 -0000	1.31
  @@ -300,15 +300,62 @@
   the least important ones.
   Currently the default level is I<info>, therefore any messages which
  -fall into the I<info> category and above (I<notice>, I<warning>,
  -etc). If for example you want to see the I<debug> messages you can
  +fall into the I<info> category and above (I<notice>, I<warning>, etc).
  +This tracing level is unrelated to the Apache's C<LogLevel> mechanism,
  +which Apache-Test sets to C<debug> in F<t/conf/httpd.conf> and you can
  +override it F<t/conf/>.
  +Let's assume you have the following code snippet:
  +  use Apache::TestTrace;
  +  warning "careful, perl on the premises";
  +  debug "that's just silly";
  +If you want to get only I<warning> messages and above, use:
  +  % t/TEST -trace=warning ...
  +now only the warning message 
  +  careful, perl on the premises
  +will be printed. If you want to see the I<debug> messages you can
   change the default level using I<-trace> option:
     % t/TEST -trace=debug ...
  -or if you want to get only I<warning> messages and above, use:
  +now the last example will print both messages.
  +By default the messages are printed to STDERR, but can be redirected
  +to a file. Refer to the C<Apache::TestTrace> manpage for more
  +Finally you can use methods: C<emerg()>, C<alert()>, C<crit()>,
  +C<error()>, C<warning()>, C<notice()>, C<info()> and C<debug()>
  +your client and server side code. This if useful for example if you
  +have some debug tracing that you don't want to be printed during the
  +normal C<make test>. However if some users have a problem you can ask
  +them to run the test suite with the trace level of 'debug' and voila
  +they can send you the extra debug output. Moreveor all these functions
  +use C<Data::Dumper> to dump arguments which are references to perl
  +structures. So for example your code may look like:
  +  use Apache::TestTrace;
  +  ...
  +  my $data = { foo => bar };
  +  debug "my data", $data;
  +and only when run with C<-trace=debug> it'll output.
  +  my data
  +  $VAR1 = {
  +            'foo' => 'bar'
  +          };
  +Normally it will not print anything.
  -  % t/TEST -trace=warning ...
   =head2 Stress Testing

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message