1Dancer::Logger::CaptureU(s3e)r Contributed Perl DocumentaDtainocner::Logger::Capture(3)
2
3
4

NAME

6       Dancer::Logger::Capture - Capture dancer logs
7

VERSION

9       version 1.3513
10

SYNOPSIS

12           set logger => "capture";
13
14           my $trap = Dancer::Logger::Capture->trap;
15           my $logs = $trap->read;
16

DESCRIPTION

18       This is a logger class for Dancer which captures all logs to an object.
19
20       Its primary purpose is for testing.
21
22   Methods
23       trap
24
25       Returns the Dancer::Logger::Capture::Trap object used to capture and
26       read logs.
27

EXAMPLE

29           use Test::More import => ['!pass'], tests => 2;
30           use Dancer;
31
32           set logger => 'capture';
33
34           warning "Danger!  Warning!";
35           debug   "I like pie.";
36
37           my $trap = Dancer::Logger::Capture->trap;
38           is_deeply $trap->read, [
39               { level => "warning", message => "Danger!  Warning!" },
40               { level => "debug",   message => "I like pie.", }
41           ];
42
43           # each call to read cleans the trap
44           is_deeply $trap->read, [];
45

SEE ALSO

47       Dancer::Logger, Dancer::Logger::Capture::Trap
48

AUTHOR

50       Dancer Core Developers
51
53       This software is copyright (c) 2010 by Alexis Sukrieh.
54
55       This is free software; you can redistribute it and/or modify it under
56       the same terms as the Perl 5 programming language system itself.
57
58
59
60perl v5.32.0                      2020-07-28        Dancer::Logger::Capture(3)
Impressum