{
    "mode": "perldoc",
    "parameter": "Net::Jabber::Log",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AJabber%3A%3ALog/json",
    "generated": "2026-06-13T12:06:34Z",
    "synopsis": "Net::Jabber::Log is a companion to the Net::Jabber module.\nIt provides the user a simple interface to set and retrieve all\nparts of a Jabber Log.",
    "sections": {
        "NAME": {
            "content": "Net::Jabber::Log - Jabber Log Module\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "Net::Jabber::Log is a companion to the Net::Jabber module.\nIt provides the user a simple interface to set and retrieve all\nparts of a Jabber Log.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "To initialize the Log with a Jabber <log/> you must pass it the\nXML::Parser Tree array.  For example:\n\nmy $log = new Net::Jabber::Log(@tree);\n\nThere has been a change from the old way of handling the callbacks.\nYou no longer have to do the above, a Net::Jabber::Log object is passed\nto the callback function for the log:\n\nuse Net::Jabber;\n\nsub log {\nmy ($Log) = @;\n.\n.\n.\n}\n\nYou now have access to all of the retrieval functions available.\n\nTo create a new log to send to the server:\n\nuse Net::Jabber;\n\n$Log = new Net::Jabber::Log();\n\nNow you can call the creation functions below to populate the tag before\nsending it.\n\nFor more information about the array format being passed to the CallBack\nplease read the Net::Jabber::Client documentation.\n",
            "subsections": [
                {
                    "name": "Retrieval functions",
                    "content": "$from       = $Log->GetFrom();\n$fromJID    = $Log->GetFrom(\"jid\");\n$type       = $Log->GetType();\n$data       = $Log->GetData();\n\n$str        = $Log->GetXML();\n@log        = $Log->GetTree();\n"
                },
                {
                    "name": "Creation functions",
                    "content": "$Log->SetLog(type=>\"error\",\nfrom=>\"users.jabber.org\",\ndata=>\"The moon is full... I can't run anymore.\");\n$Log->SetFrom(\"foo.jabber.org\");\n$Log->SetType(\"warn\");\n$Log->SetData(\"I can't find a config file.  Using defaults.\");\n"
                },
                {
                    "name": "Test functions",
                    "content": "$test = $Log->DefinedFrom();\n$test = $Log->DefinedType();\n"
                }
            ]
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Retrieval functions",
                    "content": "GetFrom()      -  returns either a string with the Jabber Identifier,\nGetFrom(\"jid\")    or a Net::Jabber::JID object for the person who\nsent the <log/>.  To get the JID object set\nthe string to \"jid\", otherwise leave blank for the\ntext string.\n\nGetType() - returns a string with the type <log/> this is.\n\nGetData() - returns a string with the cdata of the <log/>.\n\nGetXML() - returns the XML string that represents the <log/>.\nThis is used by the Send() function in Client.pm to send\nthis object as a Jabber Log.\n\nGetTree() - returns an array that contains the <log/> tag\nin XML::Parser Tree format.\n"
                },
                {
                    "name": "Creation functions",
                    "content": "SetLog(from=>string|JID, - set multiple fields in the <log/>\ntype=>string,       at one time.  This is a cumulative\ndata=>string)       and over writing action.  If you set\nthe \"from\" attribute twice, the second\nsetting is what is used.  If you set\nthe type, and then set the data\nthen both will be in the <log/>\ntag.  For valid settings read the\nspecific Set functions below.\n\nSetFrom(string) - sets the from attribute.  You can either pass a string\nSetFrom(JID)      or a JID object.  They must be valid Jabber\nIdentifiers or the server will return an error log.\n(ie.  jabber:bob@jabber.org/Silent Bob, etc...)\n\nSetType(string) - sets the type attribute.  Valid settings are:\n\nnotice     general logging\nwarn       warning\nalert      critical error (can still run but not\ncorrectly)\nerror      fatal error (cannot run anymore)\n\nSetData(string) - sets the cdata of the <log/>.\n"
                },
                {
                    "name": "Test functions",
                    "content": "DefinedFrom() - returns 1 if the from attribute is defined in the\n<log/>, 0 otherwise.\n\nDefinedType() - returns 1 if the type attribute is defined in the\n<log/>, 0 otherwise.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "By Ryan Eatmon in May of 2000 for http://jabber.org..\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "This module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "Net::Jabber::Log - Jabber Log Module",
    "flags": [],
    "examples": [],
    "see_also": []
}