home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_e36c9f740b94b650b93b3802a4af143e
< prev
next >
Wrap
Text File
|
2000-03-23
|
4KB
|
105 lines
<HTML>
<HEAD>
<TITLE>LWP::Debug - debug routines for the libwww-perl library</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> LWP::Debug - debug routines for the libwww-perl library</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>LWP::Debug - debug routines for the libwww-perl library</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use LWP::Debug qw(+ -conns);</PRE>
<PRE>
# Used internally in the library
LWP::Debug::trace('send()');
LWP::Debug::debug('url ok');
LWP::Debug::conns("read $n bytes: $data");</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>LWP::Debug provides tracing facilities. The trace(), <A HREF="#item_debug"><CODE>debug()</CODE></A> and
<A HREF="#item_conns"><CODE>conns()</CODE></A> function are called within the library and they log
information at increasing levels of detail. Which level of detail is
actually printed is controlled with the <A HREF="#item_level"><CODE>level()</CODE></A> function.</P>
<P>The following functions are available:</P>
<DL>
<DT><STRONG><A NAME="item_level"><CODE>level(...)</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_level"><CODE>level()</CODE></A> function controls the level of detail being
logged. Passing '+' or '-' indicates full and no logging
respectively. Inidividual levels can switched on and of by passing the
name of the level with a '+' or '-' prepended. The levels are:
<PRE>
trace : trace function calls
debug : print debug messages
conns : show all data transfered over the connections</PRE>
<P>The LWP::Debug module provide a special <A HREF="../../../lib/Pod/perlfunc.html#item_import"><CODE>import()</CODE></A> method that allows
you to pass the <A HREF="#item_level"><CODE>level()</CODE></A> arguments with initial use statement. If a
use argument start with '+' or '-' then it is passed to the level
function, else the name is exported as usual. The following two
statements are thus equivalent (if you ignore that the second pollutes
your namespace):</P>
<PRE>
use LWP::Debug qw(+);
use LWP::Debug qw(level); level('+');</PRE>
<P></P>
<DT><STRONG><A NAME="item_trace"><CODE>trace($msg)</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_trace"><CODE>trace()</CODE></A> function is used for tracing function
calls. The package and calling subroutine name is
printed along with the passed argument. This should
be called at the start of every major function.
<P></P>
<DT><STRONG><A NAME="item_debug"><CODE>debug($msg)</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_debug"><CODE>debug()</CODE></A> function is used for high-granularity
reporting of state in functions.
<P></P>
<DT><STRONG><A NAME="item_conns"><CODE>conns($msg)</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_conns"><CODE>conns()</CODE></A> function is used to show data being
transferred over the connections. This may generate
considerable output.
<P></P></DL>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> LWP::Debug - debug routines for the libwww-perl library</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>