Dancer...e::Trap(3pm)
π Dancer::Logger::Capture::Trap β a lil home for your captured Dancer logs π
okay bestie, so this is a page from the User Contributed Perl Documentation corner of the manual world, section 3pm, and it's literally the cutest lil storage unit for your Dancer logs π
β¨ NAME β¨
Dancer::Logger::Capture::Trap β a place to store captured Dancer logs π
πΈ VERSION πΈ
version 1.3522
π¦ SYNOPSIS π¦
my $trap = Dancer::Logger::Capture::Trap->new;
$trap->store( $level, $message );
my $logs = $trap->read;
like, that's it. that's the whole vibe. π
β¨ DESCRIPTION β¨
So basically this thing is a place to store and retrieve captured Dancer logs, and it's used by Dancer::Logger::Capture. think of it as the lil basket π§Ί that the logger drops stuff into so you can peek later. no cap.
π Methods π
new
get yourself a fresh trap. brand new, empty, iconic. β¨
store
$trap->store($level, $message);
Stores a log $message and its $level. two lil arguments, one lil log, slotted right on in. π«Ά
read
my $logs = $trap->read;
Returns the logs stored as an array ref and clears the storage. yes bestie, it empties the whole thing out β one read and the basket is empty again, so don't come crying later when your logs are gone π it's giving "use it or lose it".
For example...
[{ level => "warning", message => "Danger! Warning! Dancer!" },
{ level => "error", message => "You fail forever" }
];
look at that structure. the way it's an array ref of hash refs with level and message keys... we love a consistent shape. π
π SEE ALSO π
Dancer::Logger::Capture
π AUTHOR π
Dancer Core Developers β shoutout to the whole squad, they ate and left no crumbs. π₯
β COPYRIGHT AND LICENSE β
This software is copyright (c) 2010 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. πͺ (so yes, you can remix, share and pass it around, just keep the license energy the same, periodt.)
pssst. this one came to you viaperl v5.40.1and it's dated2026-05-05. mwah π thanks for reading, bestie β now go capture those logs! ππ
π¦ where this page comes from
- ubuntu stonking: libdancer-perl 1.3522-2 Β· 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