1Dancer2::Logger::CapturUes:e:rTrCaopn(t3r)ibuted Perl DoDcaunmceenrt2a:t:iLoongger::Capture::Trap(3)
2
3
4
6 Dancer2::Logger::Capture::Trap - a place to store captured Dancer2 logs
7
9 version 0.208001
10
12 my $trap = Dancer2::Logger::Capture::Trap->new;
13 $trap->store( $level, $message );
14 my $logs = $trap->read;
15
17 This is a place to store and retrieve capture Dancer2 logs used by
18 Dancer2::Logger::Capture.
19
20 Methods
21 new
22
23 store
24
25 $trap->store($level, $message);
26
27 Stores a log $message and its $level.
28
29 read
30
31 my $logs = $trap->read;
32
33 Returns the logs stored as an array ref and clears the storage.
34
35 For example...
36
37 [{ level => "warning", message => "Danger! Warning! Dancer2!" },
38 { level => "error", message => "You fail forever" }
39 ];
40
42 Dancer2::Logger::Capture
43
45 Dancer Core Developers
46
48 This software is copyright (c) 2019 by Alexis Sukrieh.
49
50 This is free software; you can redistribute it and/or modify it under
51 the same terms as the Perl 5 programming language system itself.
52
53
54
55perl v5.30.0 2019-08-05 Dancer2::Logger::Capture::Trap(3)