{
    "mode": "info",
    "parameter": "Log::Dispatch::Output",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/Log%3A%3ADispatch%3A%3AOutput/json",
    "generated": "2026-07-05T13:27:26Z",
    "synopsis": "package Log::Dispatch::MySubclass;\nuse Log::Dispatch::Output;\nuse base qw( Log::Dispatch::Output );\nsub new {\nmy $proto = shift;\nmy $class = ref $proto || $proto;\nmy %p = @;\nmy $self = bless {}, $class;\n$self->basicinit(%p);\n# Do more if you like\nreturn $self;\n}\nsub logmessage {\nmy $self = shift;\nmy %p    = @;\n# Do something with message in $p{message}\n}\n1;",
    "sections": {
        "Log::Dispatch::Output(User Contributed Perl DocumentLog::Dispatch::Output(3pm)": {
            "content": "",
            "subsections": []
        },
        "NAME": {
            "content": "Log::Dispatch::Output - Base class for all Log::Dispatch::* objects\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.70\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "package Log::Dispatch::MySubclass;\n\nuse Log::Dispatch::Output;\nuse base qw( Log::Dispatch::Output );\n\nsub new {\nmy $proto = shift;\nmy $class = ref $proto || $proto;\n\nmy %p = @;\n\nmy $self = bless {}, $class;\n\n$self->basicinit(%p);\n\n# Do more if you like\n\nreturn $self;\n}\n\nsub logmessage {\nmy $self = shift;\nmy %p    = @;\n\n# Do something with message in $p{message}\n}\n\n1;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module is the base class from which all Log::Dispatch::* objects\nshould be derived.\n",
            "subsections": []
        },
        "CONSTRUCTOR": {
            "content": "The constructor, \"new\", must be overridden in a subclass. See Output\nClasses for a description of the common parameters accepted by this\nconstructor.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "This class provides the following methods:\n\n$output->basicinit(%p)\nThis should be called from a subclass's constructor. Make sure to pass\nthe arguments in @ to it. It sets the object's name and minimum level\nfrom the passed parameters  It also sets up two other attributes which\nare used by other Log::Dispatch::Output methods, levelnames and\nlevelnumbers.  Subclasses will perform parameter validation in this\nmethod, and must also call the superclass's method.\n\n$output->name\nReturns the object's name.\n\n$output->minlevel\nReturns the object's minimum log level.\n\n$output->maxlevel\nReturns the object's maximum log level.\n\n$output->acceptedlevels\nReturns a list of the object's accepted levels (by name) from minimum\nto maximum.\n\n$output->log( level => $, message => $ )\nSends a message if the level is greater than or equal to the object's\nminimum level. This method applies any message formatting callbacks\nthat the object may have.\n\n$output->shouldlog ($)\nThis method is called from the \"log()\" method with the log level of the\nmessage to be logged as an argument. It returns a boolean value\nindicating whether or not the message should be logged by this\nparticular object. The \"log()\" method will not process the message if\nthe return value is false.\n\n$output->levelasnumber ($)\nThis method will take a log level as a string (or a number) and return\nthe number of that log level. If not given an argument, it returns the\ncalling object's log level instead. If it cannot determine the level\nthen it will croak.\n\n$output->addcallback( $code )\nAdds a callback (like those given during construction). It is added to\nthe end of the list of callbacks.\n\n$dispatch->removecallback( $code )\nRemove the given callback from the list of callbacks.\n",
            "subsections": []
        },
        "SUBCLASSING": {
            "content": "This class should be used as the base class for all logging objects you\ncreate that you would like to work under the Log::Dispatch\narchitecture. Subclassing is fairly trivial. For most subclasses, if\nyou simply copy the code in the SYNOPSIS and then put some\nfunctionality into the \"logmessage\" method then you should be all set.\nPlease make sure to use the \"basicinit\" method as described above.\n\nThe actual logging implementation should be done in a \"logmessage\"\nmethod that you write. Do not override \"log\"!.\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted at\n<https://github.com/houseabsolute/Log-Dispatch/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for Log-Dispatch can be found at\n<https://github.com/houseabsolute/Log-Dispatch>.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Dave Rolsky <autarch@urth.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is Copyright (c) 2020 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included\nwith this distribution.\n\nperl v5.30.3                      2020-07-23        Log::Dispatch::Output(3pm)",
            "subsections": []
        }
    },
    "summary": "Log::Dispatch::Output - Base class for all Log::Dispatch::* objects",
    "flags": [],
    "examples": [],
    "see_also": []
}