{
    "mode": "perldoc",
    "parameter": "Log::Dispatch::Code",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Log%3A%3ADispatch%3A%3ACode/json",
    "generated": "2026-06-13T19:56:45Z",
    "synopsis": "use Log::Dispatch;\nmy $log = Log::Dispatch->new(\noutputs => [\n[\n'Code',\nminlevel => 'emerg',\ncode      => \\&logit,\n],\n]\n);\nsub logit {\nmy %p = @;\nwarn $p{message};\n}",
    "sections": {
        "NAME": {
            "content": "Log::Dispatch::Code - Object for logging to a subroutine reference\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.70\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Log::Dispatch;\n\nmy $log = Log::Dispatch->new(\noutputs => [\n[\n'Code',\nminlevel => 'emerg',\ncode      => \\&logit,\n],\n]\n);\n\nsub logit {\nmy %p = @;\n\nwarn $p{message};\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module supplies a simple object for logging to a subroutine reference.\n",
            "subsections": []
        },
        "CONSTRUCTOR": {
            "content": "The constructor takes the following parameters in addition to the standard parameters documented\nin Log::Dispatch::Output:\n\n*   code ($)\n\nThe subroutine reference.\n",
            "subsections": []
        },
        "HOW IT WORKS": {
            "content": "The subroutine you provide will be called with a hash of named arguments. The two arguments are:\n\n*   level\n\nThe log level of the message. This will be a string like \"info\" or \"error\".\n\n*   message\n\nThe message being logged.\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted at <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 with this distribution.\n",
            "subsections": []
        }
    },
    "summary": "Log::Dispatch::Code - Object for logging to a subroutine reference",
    "flags": [],
    "examples": [],
    "see_also": []
}