Net::XMPP::Debug(3pm)
π NAME
okay so bestie, this is Net::XMPP::Debug β the XMPP Debug Module β from the 3pm manual section. It's the module that hands a developer easy access to logging debug info. β¨
π¦ SYNOPSIS
Net::XMPP::Debug is a module that provides a developer easy access to logging debug information. no cap, that's the whole synopsis vibe π«Ά
πΈ DESCRIPTION
Debug is a helper module for the Net::XMPP modules. It gives the Net::XMPP modules an object that controls 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. πΈ
levelβ determines the maximum level of debug messages to log:0β Base level Output (default)1β High level API calls2β Low level API calls...Nβ Whatever you want....
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β a string that will be 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, setusedefaultto1.usedefaultβ0|1; set it to1when you want to use the default filehandle.timeβ 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. π«Ά
that's the whole page, bestie. source/version footer energy: perl v5.42.0, dated 2016-01-12, and it's the Net::XMPP::Debug(3pm) manual page. byeee π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Net-XMPP 1.05-bp160.1.3 Β· LGPL-2.1+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms