LWP::DebugFile - routines for tracing/debugging LWP
use LWP::DebugFile;
For even more verbose debug output, do this instead:
use LWP::DebugFile ('+');
use LWP::DebugFile qw(+); use LWP::Debug qw(+ -conns); use LWP::Debug qw(trace);
The meanings of these are explained in the documentation for LWP::Debug. The only differences are that by default, LWP::DebugFile has "cons" debugging on, ad that (as mentioned earlier), only "non-exporting" options are available. That is, you can't do this:
use LWP::DebugFile qw(trace); # wrong
You might expect that to export LWP::Debug's "trace()" function, but it doesn't work --- it's a compile-time error.
If you don't want the files to go in the current directory, you can set $LWP::DebugFile::outpath before you load the LWP::DebugFile module:
BEGIN { $LWP::DebugFile::outpath = '/tmp/crunk/' } use LWP::DebugFile;
Note that you must end the value with a path separator (``/'' in this case --- under MacPerl it would be ``:''). With that set, you will have output files named like /tmp/crunk/lwp_3db7aede_b93.log.
If you want the LWP::DebugFile output to go a specific filespec (instead of just a uniquely named file, in whatever directory), instead set the variable $LWP::DebugFile::outname, like so:
BEGIN { $LWP::DebugFile::outname = '/home/mojojojo/lwp.log' } use LWP::DebugFile;
In that case, $LWP::DebugFile::outpath isn't consulted at all, and output is always written to the file /home/mojojojo/lwp.log.
Note that the value of $LWP::DebugFile::outname doesn't need to be an absolute filespec. You can do this:
BEGIN { $LWP::DebugFile::outname = 'lwp.log' } use LWP::DebugFile;
In that case, output goes to a file named lwp.log in the current directory --- specifically, whatever directory is current when LWP::DebugFile is first loaded. $LWP::DebugFile::outpath is still not consulted --- its value is used only if $LWP::DebugFile::outname isn't set.
That is, if you have "LWPDEBUGFILE" set to /home/mojojojo/lwp.log, then you can just start out your program with:
use LWP::DebugFile;
and it will act as if you had started it like this:
BEGIN { $LWP::DebugFile::outname = '/home/mojojojo/lwp.log' } use LWP::DebugFile;
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |