line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: adds a logger to a class |
2
|
|
|
|
|
|
|
|
3
|
19
|
|
|
19
|
|
188840
|
use strict; |
|
19
|
|
|
|
|
44
|
|
|
19
|
|
|
|
|
528
|
|
4
|
19
|
|
|
19
|
|
188
|
use warnings; |
|
19
|
|
|
|
|
44
|
|
|
19
|
|
|
|
|
1010
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package App::Rssfilter::Logger; |
9
|
|
|
|
|
|
|
$App::Rssfilter::Logger::VERSION = '0.08'; # TRIAL |
10
|
19
|
|
|
19
|
|
96
|
use Moo::Role; |
|
19
|
|
|
|
|
38
|
|
|
19
|
|
|
|
|
127
|
|
11
|
19
|
|
|
19
|
|
64020
|
use Log::Any; |
|
19
|
|
|
|
|
144932
|
|
|
19
|
|
|
|
|
90
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'logger' => ( |
15
|
|
|
|
|
|
|
is => 'lazy', |
16
|
|
|
|
|
|
|
default => sub { Log::Any->get_logger() }, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__END__ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=pod |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=encoding UTF-8 |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
App::Rssfilter::Logger - adds a logger to a class |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 VERSION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
version 0.08 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SYNOPSIS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
package Foo; |
38
|
|
|
|
|
|
|
use Moo; # or Role::Tiny::With; |
39
|
|
|
|
|
|
|
with 'App::Rssfilter::Logger'; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
package main; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $foo = Foo->new; |
44
|
|
|
|
|
|
|
$foo->logger->debug( 'logging to my fresh new foo' ); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
C<App::Rssfilter::Logger> is a role that can be composed into any class, and adds a C<logger> attribute which can be used to log to a L<Log::Any::Adapter>. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 logger |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This is a L<Log::Any> object. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 SEE ALSO |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=over 4 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item * |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
L<Log::Any> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item * |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
L<Log::Any::Adapter> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=back |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Daniel Holz <dgholz@gmail.com> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Daniel Holz. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |