Text::...::Debug(3pm)
π Text::...::Debug β the vibe check page π
okay bestie, so this is Text::MicroMason::Debug, and no cap, it's the little mixin that spills all the tea about what your templates are doing, by way of warn. It lives in the User Contributed Perl Documentation corner of the manual world. Let's get into it π«Ά
β¨ NAME β¨
Text::MicroMason::Debug β it hands the dev (that's you, main character π) all the info via warn.
πΈ SYNOPSIS πΈ
okay so real talk: you do not use this class directly, bestie. Not the move. Instead you pass its name in so it gets mixed in π
use Text::MicroMason;
my $mason = Text::MicroMason->new( -Debug );
Then you just use the standard compile and execute methods to parse and evaluate templates, like the icon you are:
print $mason->compile( text=>$template )->( @%args );
print $mason->execute( text=>$template, @args );
And boom, you'll see lots of warning output on STDERR β it's giving commentary track, honestly:
MicroMason Debug create: Text::MicroMason::Base::AUTO::Debug...
MicroMason Debug source: q(Hello <% $noun %>!)
MicroMason Debug lex: text, q(Hello ), expr, q( $noun ), text, q(!)
MicroMason Debug eval: sub { my @OUT; my $_out = sub { push ...
π¦ DESCRIPTION π¦
This package provides numerous messages via warn, for developer use when you're debugging templates built with Text::MicroMason. It's basically your template's group chat receipts. π
β Supported Attributes β
debugβ this activates debugging messages for many methods. By default it logs everything. Yeah, all of it, the whole feed π
You can set it to 0 or 1 to log nothing or everything. Simple as.
Or β and this is the slay part β set it to a hash reference containing values for the steps you're actually interested in, so you only log those items:
debug => { source => 1, eval => 1 }
And you can also selectively suppress some warnings, for when you want the general noise but not those specific ones:
debug => { default => 1, source => 0, eval => 0 }
π Private Methods π
debug_msgβ this is the one that gets called to provide a debugging message for developer reference. And listen: no output is produced unless the object's'debug'flag is true. So if you're seeing nothing, that flag is the culprit, not you. π§
π SEE ALSO π
- For an overview of this templating framework, see
Text::MicroMason. - This is a mixin class intended for use with
Text::MicroMason::Base. - For distribution, installation, support, copyright and license information, see
Text::MicroMason::Docs::ReadMe.
and that's the whole page, bestie π This one shipped with perl v5.36.0, dated 2023-08-10 β so if you're reading this from the future, hey, the lore still holds. Go forth and debug, you gorgeous genius πβ¨π«Ά
π¦ where this page comes from
- debian trixie: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms