Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::xmpp::debug(3) [suse man page]

Net::XMPP::Debug(3)					User Contributed Perl Documentation				       Net::XMPP::Debug(3)

NAME
Net::XMPP::Debug - XMPP Debug Module 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 = new Net::XMPP::Debug(); $Debug->Init(level=>2, file=>"stdout", header=>"MyScript"); $Debug->Log0("Connection established"); METHODS
Basic Functions 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(level=>integer, - initializes the debug object. The level file=>string, determines the maximum level of debug header=>string, messages to log: setdefault=>0|1, 0 - Base level Output (default) usedefault=>0|1, 1 - High level API calls time=>0|1) 2 - Low level API calls ... N - Whatever you want.... The file 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. header 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"). setdefault saves the current filehandle and makes it available for other Debug objects to use. To use the default set usedefault to 1. The time parameter specifies whether or not to add a timestamp to the beginning of each logged line. 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 = new Net::XMPP:Debug(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
Ryan Eatmon COPYRIGHT
This module is free software, you can redistribute it and/or modify it under the LGPL. perl v5.12.1 2010-07-05 Net::XMPP::Debug(3)

Check Out this Related Man Page

Net::XMPP::Client(3pm)					User Contributed Perl Documentation				    Net::XMPP::Client(3pm)

NAME
Net::XMPP::Client - XMPP Client Module SYNOPSIS
Net::XMPP::Client is a module that provides a developer easy access to the Extensible Messaging and Presence Protocol (XMPP). DESCRIPTION
Client.pm uses Protocol.pm to provide enough high level APIs and automation of the low level APIs that writing an XMPP Client in Perl is trivial. For those that wish to work with the low level you can do that too, but those functions are covered in the documentation for each module. Net::XMPP::Client provides functions to connect to an XMPP server, login, send and receive messages, set personal information, create a new user account, manage the roster, and disconnect. You can use all or none of the functions, there is no requirement. For more information on how the details for how Net::XMPP is written please see the help for Net::XMPP itself. For a full list of high level functions available please see Net::XMPP::Protocol. Basic Functions use Net::XMPP; $Con = new Net::XMPP::Client(); $Con->SetCallbacks(...); $Con->Execute(hostname=>"jabber.org", username=>"bob", password=>"XXXX", resource=>"Work' ); # # For the list of available functions see Net::XMPP::Protocol. # $Con->Disconnect(); METHODS
Basic Functions new(debuglevel=>0|1|2, - creates the Client object. debugfile debugfile=>string, should be set to the path for the debug debugtime=>0|1) log to be written. If set to "stdout" then the debug will go there. debuglevel controls the amount of debug. For more information about the valid setting for debuglevel, debugfile, and debugtime see Net::XMPP::Debug. Connect(hostname=>string, - opens a connection to the server port=>integer, listed in the hostname (default timeout=>int localhost), on the port (default connectiontype=>string, 5222) listed, using the tls=>0|1) connectiontype listed (default tcpip). The two connection types available are: tcpip standard TCP socket http TCP socket, but with the headers needed to talk through a web proxy If you specify tls, then it TLS will be used if it is available as a feature. Execute(hostname=>string, - Generic inner loop to handle port=>int, connecting to the server, calling tls=>0|1, Process, and reconnecting if the username=>string, connection is lost. There are password=>string, five callbacks available that are resource=>string, called at various places: register=>0|1, onconnect - when the client has connectiontype=>string, made a connection. connecttimeout=>string, onauth - when the connection is connectattempts=>int, made and user has been connectsleep=>int, authed. Essentially, processtimeout=>int) this is when you can start doing things as a Client. Like send presence, get your roster, etc... onprocess - this is the most inner loop and so gets called the most. Be very very careful what you put here since it can *DRASTICALLY* affect performance. ondisconnect - when the client disconnects from the server. onexit - when the function gives up trying to connect and exits. The arguments are passed straight on to the Connect function, except for connectattempts and connectsleep. connectattempts is the number of times that the Component should try to connect before giving up. -1 means try forever. The default is -1. connectsleep is the number of seconds to sleep between each connection attempt. If you specify register=>1, then the Client will attempt to register the sepecified account for you, if it does not exist. Process(integer) - takes the timeout period as an argument. If no timeout is listed then the function blocks until a packet is received. Otherwise it waits that number of seconds and then exits so your program can continue doing useful things. NOTE: This is important for GUIs. You need to leave time to process GUI commands even if you are waiting for packets. The following are the possible return values, and what they mean: 1 - Status ok, data received. 0 - Status ok, no data received. undef - Status not ok, stop processing. IMPORTANT: You need to check the output of every Process. If you get an undef then the connection died and you should behave accordingly. Disconnect() - closes the connection to the server. Connected() - returns 1 if the Transport is connected to the server, and 0 if not. AUTHOR
Ryan Eatmon COPYRIGHT
This module is free software, you can redistribute it and/or modify it under the LGPL. perl v5.14.2 2012-11-06 Net::XMPP::Client(3pm)
Man Page