Dancer...Message(3pm)
π NAME
Dancer2::Plugin::LogReport::Message β it's the extended Log::Report message class, bestie. Section 3pm, Perl docs, you know the drill β¨
π«Ά INHERITANCE
Dancer2::Plugin::LogReport::Message
is a Log::Report::Message
Like, it literally is one. It just got a glow-up π
πΈ SYNOPSIS
Okay so in your template you're gonna do this:
[% FOR message IN messages %]
<div class="alert alert-[% message.bootstrap_color %]">
[% message.toString | html_entity %]
</div>
[% END %]
That's it. That's the whole vibe check π <kbd> not needed, just copy-paste and slay.
β¨ DESCRIPTION
[The Dancer2 plugin was contributed by Andrew Beverley] β giving credit where credit is due, we love to see it π
So this class is an extension of Log::Report::Message, right? But with functions specifically designed for Dancer applications. It's giving main character energy, but make it error handling.
The functions are minimal, ngl β currently it's only aimed at Bootstrap β but if you have ideas for new ones, they are totally welcome π Like, genuinely, slide into that contributor list.
Also: extends "DESCRIPTION" in Log::Report::Message. So go read that too, iykyk.
π¦ METHODS
Extends "METHODS" in Log::Report::Message. The originals didn't go anywhere, they're still iconic.
$obj->bootstrap_color()β gets you a suitable Bootstrap context color for the message. You use it exactly like in the SYNOPSIS above, no cap. Here's the mapping, and yes it's very specific:"success"is used forDancer2::Plugin::LogReport::success()messages"info"colors are used for messages"notice"and below"warning"is used for"warning"and"mistake""danger"is used for all other messages π
$obj->reason()β get or set the reason of a message. Both. It's versatile like that π
π₯ DETAILS
Extends "DETAILS" in Log::Report::Message. Yeah, the whole details section. Go look, it's all there π
π§ OVERLOADING
Extends "OVERLOADING" in Log::Report::Message. Three overloads, all inherited, all still doing their thing:
- overload:
as $functionβ inherited, see "OVERLOADING" in Log::Report::Message - overload:
concatenationβ inherited, see "OVERLOADING" in Log::Report::Message - overload:
stringificationβ inherited, see "OVERLOADING" in Log::Report::Message
That's right, all three say the same thing. Not me pointing it out, but also not not pointing it out π
β SEE ALSO
This module is part of the Log-Report distribution, version 1.40, built on April 18, 2025. Website: http://perl.overmeer.net/CPAN/ β go visit, it's literally right there π¦
π LICENSE
Copyrights 2007-2025 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog β the whole crew, we love them π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
Fr fr, same terms as Perl itself. Don't be weird about it π«Ά
And that's the whole page, bestie π Docs brought to you by perl v5.40.1, dated 2025-04-20 β Dancer...Message(3pm) out. πβ¨π
π¦ where this page comes from
- debian trixie: liblog-report-perl 1.40-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: liblog-report-perl 1.40-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms