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 for Dancer2::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