William McKee wrote:
On Wed, Jan 21, 2004 at 12:35:07PM -0800, Stas Bekman wrote:

William McKee wrote:

The testing documentation at perl.apache.org says that the current trace
level defaults to info. However, my system is outputting debug messages
to the t/logs/error_log file. Is this the correct behavior in which case
the docs are wrong? Or have I somehow configured my system to default to
debug mode?

What are the 'debug' messages you are talking about?


The [debug] messages in the t/logs/error_log. In particular the ones
that look like the following:

[Wed Jan 21 15:58:25 2004] [debug] mod_cvs.c(217): CVSCheck is off here: /index.html

Thanks.

The Apache LogLevel is set to 'debug':

% grep Level t/conf/httpd.conf
LogLevel    debug


That's the one I needed to set.

You can override it later in your extra conf files. But it's a good idea to keep it at the debug level.


The Apache-Test tracing mechanism is set to 'info'. so:

use Apache::TestTrace;
info "doing foo";  # will be logged
debug "doing bar"; # won't be logged


That makes sense now. I'm still getting the client and server stuff
mixed up :).

You don't. Apache::TestTrace works on the client and the server sides. It's the tracing of Apache-Test, which is unrelated to logging of Apache.


--- testing.pod.orig 2004-01-21 16:21:48.000000000 -0500
+++ testing.pod.wlm 2004-01-21 16:31:09.000000000 -0500
@@ -310,6 +310,10 @@
% t/TEST -trace=warning ...
+These messages are printed to STDOUT during testing. See Apache::TestTrace for
+more information. To control the messages printed to the server error_log, set
+the Apache directive LogLevel. See the Apache documentation at httpd.apache.org
+for more details.

Thanks, William, but it prints the messages to STDERR. This is documented in the Apache::TestTrace manpage. I'll commit an adjusted version of your patch.


It takes some time to learn to appreciate Apache::TestTrace. It allows you to keep your debug messages in the code without commenting them out and they won't print anything till you run the test suite with:

  t/TEST -trace=debug

or use the env variable. It also does a lot of magic for you, like dumping perl structures via Data::Dumper. I also use the 'error' tracing function quite a lot when I have a lot of debug output and I want some of it to stand out. error() prints it in bold red.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to