logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Perinci::CmdLine::Manual::HowTo::Debugging - How-to guides related to debugging

Author

       perlancar <perlancar@cpan.org>

Bugs

       Please report any bugs or feature requests on the bugtracker website
       <https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-CmdLine>

       When submitting a bug or request, please include a test-file or a patch to an existing test-file that
       illustrates the bug or desired feature.

perl v5.40.0                                       2024-11-15             Perinci::CmdLin...owTo::Debugging(3pm)

Contributing

       To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

       Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then
       test via:

        % prove -l

       If you want to build the distribution (e.g. to try to install it locally on your system), you can install
       Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR,
       and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required
       beyond that are considered a bug and can be reported to me.

Description

       If you encounter issues with Perinci::CmdLine, you can try these things to aid with debugging:

       Increaseloglevel. Perinci::CmdLine uses Log::ger. If your command-line object is instantiated with
       "log" attribute set to true, you just need to specify "--verbose", "--debug", or "--trace" command-line
       options to see more logging statements:

        % your-cli --verbose ...
        % your-cli --debug ...
        % your-cli --trace ...
        % your-cli --log-level trace ... ;# ditto

       If your command-line object is not instantiated with "log" attribute set to true, you can enable logging
       with:

        % PERL5OPT=-MLog::ger::Screen LOG_LEVEL=info your-cli ...
        % PERL5OPT=-MLog::ger::Screen DEBUG=1 your-cli ...
        % PERL5OPT=-MLog::ger::Screen TRACE=1 your-cli ...

       Dumpparsedarguments,internaldatastructures. If seeing log statements does not give clue, you can try
       dumping various data structures. This can be done with plugins. For example, to dump parsed command-line
       arguments after validation and then exit, you can use the following command (setting log level to trace
       is helpful to see the program flow and at what points the plugins are triggered):

        % PERINCI_CMDLINE_PLUGINS=-DumpArgs,-Exit@after_validate_args your-cli --trace ...

       Loggingothercomponents. See Log::ger::For::LWP, Log::ger::For::HTTP::Tiny, Log::ger::For::DBI,
       Log::ger::DBI::Query.

Homepage

       Please visit the project's homepage at <https://metacpan.org/release/Perinci-CmdLine>.

Name

       Perinci::CmdLine::Manual::HowTo::Debugging - How-to guides related to debugging

See Also

       Log::ger

Source

       Source repository is at <https://github.com/perlancar/perl-Perinci-CmdLine>.

Version

       This document describes version 2.000.1 of Perinci::CmdLine::Manual::HowTo::Debugging (from Perl
       distribution Perinci-CmdLine), released on 2024-11-12.

See Also