Dancer...Capture(3pm)
π Dancer::Logger::Capture β capturing dancer logs, bestie π
okay so this is one of those pages from the User Contributed Perl Documentation collection, and it's Dancer::Logger::Capture, version 1.3522 β¨ it's a tiny little thing and it's lowkey iconic, so let's get into it π
β¨ NAME β¨
Dancer::Logger::Capture β captures dancer logs, that's the whole job π
πΈ VERSION πΈ
version 1.3522 π
π¦ SYNOPSIS π¦
set logger => "capture";
my $trap = Dancer::Logger::Capture->trap;
my $logs = $trap->read;
like. that's it. three lines. main character energy fr fr π
π« DESCRIPTION π«
okay so bestie, this is a logger class for Dancer, and what it does is it captures all the logs into an object π¦β¨
its primary purpose? testing. periodt. that's what it's for π
π Methods π
trap
returns the Dancer::Logger::Capture::Trap object that you use to capture and read logs πͺ€π it's giving "i set a trap and the logs walked right into it" and honestly? obsessed.
π EXAMPLE π
here's the whole vibe, verbatim, no notes:
use Test::More import => ['!pass'], tests => 2;
use Dancer;
set logger => 'capture';
warning "Danger! Warning!";
debug "I like pie.";
my $trap = Dancer::Logger::Capture->trap;
is_deeply $trap->read, [
{ level => "warning", message => "Danger! Warning!" },
{ level => "debug", message => "I like pie.", }
];
# each call to read cleans the trap
is_deeply $trap->read, [];
okay important detail because everyone misses it: each call to read cleans the trap π§Ή so the second read gives you an empty array. she empties herself out every single time. iconic behaviour honestly πβ¨
π₯ SEE ALSO π₯
Dancer::LoggerDancer::Logger::Capture::Trap
go read those too, bestie, iykyk π«Ά
π AUTHOR π
the Dancer Core Developers π
π 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 π (yes that means free free, go wild but read the license fr)
okay that's the whole page!! π and a cute little sign-off for you: this was perl v5.40.1, dated 2026-05-05, and that's the Dancer...Capture(3pm) footer moment π β¨ love u, go write some tests ππ¦
π¦ 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