Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  NET::SIP::DEBUG (3)

.ds Aq ’


Net::SIP::Debug - debugging of Net::SIP



  use Net::SIP::Debug 1;
  use Net::SIP::Debug qw( Net::SIP*=0 Registrar=1 );

  perl -MNet::SIP::Debug=1


Provides debugging support for Net::SIP. Debugging can be enabled/disabled globally or per package and optional per subpackage.

It provides support for different debugging levels, e.g. the higher the level, the more debugging is done. The following levels are used:
1. Debug messages for users
2. Includes short SIP packet dumps of incoming and outgoing data
3. Includes detailed SIP packet dumps for incoming and outgoing data
4. Includes information about call flow, e.g. why packets get dropped etc.
5. Detailed debugging for programmers using Net::SIP.
6. Detailed debugging for core developers of Net::SIP.


import ( @ARGS ) Extracts everything from arguments given to use which might be usable by <B>levelB> and forwards rest to Exporter.

If the argument is a reference to a subroutine it will be used for showing the debug message instead of printing it to STDERR. In this case the usual prefixes incl the time will not be added (useful for forwarding debug to syslog).

level ( @ARGS ) Enables/disables debugging depending on @ARGS. @ARGS might contain the following specifications:
NUMBER NUMBER will be interpreted as the debugging level. It’s used in <B>debugB> etc to print only debug message which a level lower or equal to NUMBER.
PACKAGE Enables debugging for package PACKAGE. PACKAGE might be a fully qualified package (e.g. Net::SIP::Registrar) or the Net or Net::SIP might be ommited (Registrar). If a * is added the debugging will also be enabled for subpackages, e.g. Endpoint* will enable debugging for Net::SIP::Endpoint and Net::SIP::Endpoint::Context too.
PACKAGE=NUMBER Similar to the previous item, but this sets debugging level to NUMBER for the specified packages and thus can also be used to selectivly disable debugging for some packages.

If @ARGS is empty it will return the debugging level for the package which called this method (the first package in the caller stack which is not Net::SIP::Debug itself).

set_prefix ( PREFIX ) Sets prefix used for debug messages to PREFIX. Default prefix is ’DEBUG:’ but for instance for forking applications it might be useful to change this to DEBUG($$): or similar.


DEBUG|debug ( [ LEVEL ],( MESSAGE | FMT,@ARG )) If debugging is enabled it will print to STDERR debugging info. If multiple arguments are given to the function they will be fed into <B>sprintfB> to create a single message.

If the first argument looks like a number (see <B>looks_like_numberB> in Scalar::Util) it will be interpreted as the debug level for this message, e.g. if it is higher than the user specified debug level the message will not be printed.

The MESSAGE (or the result from sprintf(FMT,@ARG)) will be prefixed by the callers package, the callers function and the line from which DEBUG was called. In front of the prefix the current time (as float time_t) and the string DEBUG: will be added.

If the message consists of multiple lines each line will be prefixed by the prefix and all but the first line will also have a TAB added between prefix and message data.

The function is by default exported as <B>DEBUGB> and can by exported as <B>debugB> too.

DEBUG_DUMP ( [ LEVEL ], @DATA ) Will call <B>debugB> with the output from Data::Dumpers <B>DumperB> if debugging is enabled. If @DATA has more than one item it will be fed as reference into <B>DumperB>, otherwise only the single item will be fed to <B>DumperB>. For the meaning of LEVEL see <B>debugB>.

This function is exported by default.

stacktrace ( MESSAGE | FMT,@ARG ) Uses the arguments in <B>debugB>, but instead of writing a debug message to STDERR it will be used in Carp::longmess. Returns string with stacktrace.
LEAK_TRACK ( REF ) This is used internally for tracking leaks. It will rebless REF into a new class which behaves like the old one. Calls of LEAK_TRACK and DESTROY on this class will be tracked and shown. If Devel::Peek can be loaded it will <B>DumpB> information about the REF on each call to LEAK_TRACK.

Exported by default.


Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 34: You have ’=item 5’ instead of the expected ’=item 3’
Around line 38: You have ’=item 10’ instead of the expected ’=item 4’
Around line 42: You have ’=item 50’ instead of the expected ’=item 5’
Around line 46: You have ’=item 100’ instead of the expected ’=item 6’
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 NET::SIP::DEBUG (3) 2010-02-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.