Dancer2...e::Trap(3)
π Dancer2::Logger::Capture::Trap(3) π
User Contributed Perl Documentation Β· Dancer2::Logger::Capture::Trap(3)
okay bestie sit DOWN because this one is short and sweet and honestly kind of iconic π
β¨ NAME β¨
Dancer2::Logger::Capture::Trap β it's literally just a lil place to store captured Dancer2 logs π
πΈ VERSION πΈ
version 2.2.1
π¦ SYNOPSIS π¦
my $trap = Dancer2::Logger::Capture::Trap->new;
$trap->store( $level, $message );
my $logs = $trap->read;
that's it. that's the whole vibe. new one up, toss logs in, pull logs out. slay β¨
π DESCRIPTION π
so like⦠this is a place to store and retrieve capture Dancer2 logs 𫢠it's the little storage buddy that Dancer2::Logger::Capture uses to keep its receipts. no cap, that's genuinely the whole job.
π Methods π
new
makes you a fresh trap, bestie. brand new, zero logs, immaculate energy π
store
$trap->store($level, $message);
Stores a log $message and its $level. two little args, both doing their part, main character energy fr fr π
read
my $logs = $trap->read;
Returns the logs stored as an array ref and β heads up, this is the important bit β clears the storage π like, it reads them and then it's like "okay bye, gone, empty." so if you read twice, the second read gets nothing. no notes, that's just how it works.
For example...
[{ level => "warning", message => "Danger! Warning! Dancer2!" },
{ level => "error", message => "You fail forever" }
];
look at that structure. level and message keys, one hash per log, in a tidy array ref. we love a consistent format π
π SEE ALSO π
Dancer2::Logger::Captureβ the bestie that actually does the capturing, this page is just its storage unit π§
π AUTHOR π
Dancer Core Developers β legends, honestly.
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2026 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free free free, as it should be π«Ά
and that's the whole page, bestie!! perl v5.42.3, dated 2026-09-20 β go forth and capture those logs π β¨π¦
π¦ where this page comes from
- fedora 44: perl-Dancer2 2.2.1-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms