GSP
Quick Navigator

Search Site

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

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


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

.ds Aq ’

NAME

Net::XMPP::Debug - XMPP Debug Module

CONTENTS

SYNOPSIS

Net::XMPP::Debug is a module that provides a developer easy access to logging debug information.

DESCRIPTION

Debug is a helper module for the Net::XMPP modules. It provides the Net::XMPP modules with an object to control where, how, and what is logged.

    Basic Functions



    $Debug = Net::XMPP::Debug->new();

    $Debug->Init(
           level  => 2,
           file   => "stdout",
           header =>"MyScript");

    $Debug->Log0("Connection established");



METHODS

    Basic Functions

new


    new(hash)



creates the Debug object. The hash argument is passed to the Init function. See that function description below for the valid settings.

Init


    Init(
         level      => integer,
         file       => string,
         header     => string,
         setdefault => 0|1,
         usedefault => 0|1,
         time       => 0|1)



initializes the debug object.

The <B>levelB> determines the maximum level of debug messages to log:



  0 - Base level Output (default)
  1 - High level API calls
  2 - Low level API calls
  ...
  N - Whatever you want....



The <B>fileB> determines where the debug log goes. You can either specify a path to a file, or stdout (the default). stdout tells Debug to send all of the debug info sent to this object to go to stdout.

<B>headerB> is a string that will preappended to the beginning of all log entries. This makes it easier to see what generated the log entry (default is Debug).

<B>setdefaultB> saves the current filehandle and makes it available for other Debug objects to use. To use the default set <B>usedefaultB> to 1.

The <B>timeB> parameter specifies whether or not to add a timestamp to the beginning of each logged line.

LogN


  LogN(array)



Logs the elements of the array at the corresponding debug level N. If you pass in a reference to an array or hash then they are printed in a readable way. (ie... Log0, Log2, Log100, etc...)

EXAMPLE



  $Debug = Net::XMPP:Debug->new(level=>2,
                               header=>"Example");

  $Debug->Log0("test");

  $Debug->Log2("level 2 test");

  $hash{a} = "atest";
  $hash{b} = "btest";

  $Debug->Log1("hashtest", \%hash);



You would get the following log:



    Example: test
    Example: level 2 test
    Example: hashtest { a=>"atest" b=>"btest" }



If you had set the level to 1 instead of 2 you would get:



    Example: test
    Example: hashtest { a=>"atest" b=>"btest" }



AUTHOR

Originally authored by Ryan Eatmon.

Previously maintained by Eric Hacker.

Currently maintained by Darian Anthony Patrick.

COPYRIGHT

This module is free software, you can redistribute it and/or modify it under the LGPL 2.1.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::XMPP::DEBUG (3) 2016-03-17

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