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