Filename | /usr/local/lib/site_perl/Log/Filter/All.pm |
Statements | Executed 14 statements in 395µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 474µs | 764µs | BEGIN@71 | Log::Filter::All::
1 | 1 | 1 | 12µs | 15µs | BEGIN@2 | Log::Filter::All::
1 | 1 | 1 | 10µs | 45µs | BEGIN@66 | Log::Filter::All::
1 | 1 | 1 | 8µs | 8µs | BEGIN@74 | Log::Filter::All::
1 | 1 | 1 | 7µs | 36µs | BEGIN@75 | Log::Filter::All::
1 | 1 | 1 | 6µs | 12µs | BEGIN@3 | Log::Filter::All::
1 | 1 | 1 | 2µs | 2µs | END | Log::Filter::All::
0 | 0 | 0 | 0s | 0s | _init | Log::Filter::All::
0 | 0 | 0 | 0s | 0s | accept | Log::Filter::All::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Log::Filter::All; | ||||
2 | 2 | 22µs | 2 | 18µs | # spent 15µs (12+3) within Log::Filter::All::BEGIN@2 which was called:
# once (12µs+3µs) by Log::Loger::BEGIN@119 at line 2 # spent 15µs making 1 call to Log::Filter::All::BEGIN@2
# spent 3µs making 1 call to strict::import |
3 | 2 | 51µs | 2 | 17µs | # spent 12µs (6+5) within Log::Filter::All::BEGIN@3 which was called:
# once (6µs+5µs) by Log::Loger::BEGIN@119 at line 3 # spent 12µs making 1 call to Log::Filter::All::BEGIN@3
# spent 5µs making 1 call to warnings::import |
4 | |||||
5 | ################################################################################ | ||||
6 | # | ||||
7 | # DOCUMENTATION SECTION | ||||
8 | # | ||||
9 | ################################################################################ | ||||
10 | |||||
11 | =head1 NAME | ||||
12 | |||||
13 | Log::Filter::All - Filter, that accepts all log messages (AUTHORITATIVE) | ||||
14 | |||||
15 | =head1 SYNOPSIS | ||||
16 | |||||
17 | use Log::Filter::All; | ||||
18 | |||||
19 | my $filter = new Log::Filter::All(); | ||||
20 | my ($result, $continue) = $filter->accept($source, $severity, $message); | ||||
21 | |||||
22 | =head1 DESCRIPTION | ||||
23 | |||||
24 | This filter accepts all messages. It is authoritative, so it`s result is | ||||
25 | final and evaluation will not continue. | ||||
26 | |||||
27 | =head1 USAGE | ||||
28 | |||||
29 | =head1 BUGS | ||||
30 | |||||
31 | =head1 SUPPORT | ||||
32 | |||||
33 | =head1 AUTHOR | ||||
34 | |||||
35 | Jan Mach | ||||
36 | Cesnet, z.s.p.o | ||||
37 | jan.mach@cesnet.cz | ||||
38 | http://www.cesnet.cz | ||||
39 | |||||
40 | =head1 COPYRIGHT | ||||
41 | |||||
42 | This program is free software; you can redistribute | ||||
43 | it and/or modify it under the same terms as Perl itself. | ||||
44 | |||||
45 | The full text of the license can be found in the | ||||
46 | LICENSE file included with this module. | ||||
47 | |||||
48 | |||||
49 | =head1 SEE ALSO | ||||
50 | |||||
51 | perl(1). | ||||
52 | |||||
53 | =head1 FUNCTION REFERENCE | ||||
54 | |||||
55 | =over 4 | ||||
56 | |||||
57 | =cut | ||||
58 | |||||
59 | ################################################################################ | ||||
60 | # | ||||
61 | # INITIALIZATION AND CLEANUP SECTION | ||||
62 | # | ||||
63 | ################################################################################ | ||||
64 | |||||
65 | #-- Perl core modules ---------------------------------------------------------# | ||||
66 | 2 | 25µs | 2 | 81µs | # spent 45µs (10+36) within Log::Filter::All::BEGIN@66 which was called:
# once (10µs+36µs) by Log::Loger::BEGIN@119 at line 66 # spent 45µs making 1 call to Log::Filter::All::BEGIN@66
# spent 36µs making 1 call to Exporter::import |
67 | |||||
68 | #-- Perl CPAN modules ---------------------------------------------------------# | ||||
69 | |||||
70 | #-- Custom application modules ------------------------------------------------# | ||||
71 | 2 | 108µs | 1 | 764µs | # spent 764µs (474+290) within Log::Filter::All::BEGIN@71 which was called:
# once (474µs+290µs) by Log::Loger::BEGIN@119 at line 71 # spent 764µs making 1 call to Log::Filter::All::BEGIN@71 |
72 | |||||
73 | #-- Module initializations ----------------------------------------------------# | ||||
74 | # spent 8µs within Log::Filter::All::BEGIN@74 which was called:
# once (8µs+0s) by Log::Loger::BEGIN@119 at line 78 | ||||
75 | 2 | 30µs | 2 | 65µs | # spent 36µs (7+29) within Log::Filter::All::BEGIN@75 which was called:
# once (7µs+29µs) by Log::Loger::BEGIN@119 at line 75 # spent 36µs making 1 call to Log::Filter::All::BEGIN@75
# spent 29µs making 1 call to vars::import |
76 | 2 | 8µs | $VERSION = '0.01'; | ||
77 | @ISA = ('Log::Filter::Module'); | ||||
78 | 1 | 147µs | 1 | 8µs | } # spent 8µs making 1 call to Log::Filter::All::BEGIN@74 |
79 | |||||
80 | |||||
81 | #-- Module clean-up code (global destructor) ----------------------------------# | ||||
82 | 1 | 2µs | # spent 2µs within Log::Filter::All::END which was called:
# once (2µs+0s) by main::RUNTIME at line 0 of mentat.storage.mongo.pl | ||
83 | |||||
84 | } | ||||
85 | |||||
86 | ################################################################################ | ||||
87 | # | ||||
88 | # CONSTANTS AND GLOBAL VARIABLES DEFINITION SECTION | ||||
89 | # | ||||
90 | ################################################################################ | ||||
91 | |||||
92 | #-- Constants -----------------------------------------------------------------# | ||||
93 | |||||
94 | #-- Static public class variables (our) ---------------------------------------# | ||||
95 | |||||
96 | #-- Static protected class variables (my) -------------------------------------# | ||||
97 | |||||
98 | ################################################################################ | ||||
99 | # | ||||
100 | # IMPLEMENTATION SECTION | ||||
101 | # | ||||
102 | ################################################################################ | ||||
103 | |||||
104 | =item accept($$$) [PUBLIC] | ||||
105 | |||||
106 | Usage : my ($result, $continue) = $filter->accept($source, $severity, $message); | ||||
107 | Purpose : Check, if the filter will accept the given message | ||||
108 | Returns : Array (Log::Filter::Module::ACCEPT, Log::Filter::Module::FINISH) | ||||
109 | Arguments : string $source - Name of the source of the message | ||||
110 | enum $severity - Severity in integer or string format (see Log::Core::Essentials for permited values) | ||||
111 | string $message - Message | ||||
112 | Throws : Croaks, if invoked on class, or if given invalid arguments | ||||
113 | Comments : | ||||
114 | See Also : | ||||
115 | |||||
116 | =cut | ||||
117 | |||||
118 | sub accept($$$) { | ||||
119 | my $self = shift; | ||||
120 | croak ((caller(0))[3] . ": instance method invoked on class") unless ref $self; | ||||
121 | my ($source, $severity, $message) = @_; | ||||
122 | croak ((caller(0))[3] . ": invalid arguments") unless (defined($source) and defined($severity) and defined($message)); | ||||
123 | |||||
124 | # Always return success, our result is authoritative | ||||
125 | return (Log::Filter::Module::ACCEPT, Log::Filter::Module::FINISH); | ||||
126 | } | ||||
127 | |||||
128 | =item _init() [PROTECTED] | ||||
129 | |||||
130 | Usage : Used from constructor as follows: return $self->_init(@_); | ||||
131 | Purpose : Initialize newly created filter instance | ||||
132 | Returns : $self | ||||
133 | Arguments : None | ||||
134 | Throws : Croaks, if invoked on class | ||||
135 | Comments : Internally used by parent`s new() method | ||||
136 | See Also : | ||||
137 | |||||
138 | =cut | ||||
139 | |||||
140 | sub _init { | ||||
141 | my $self = shift; | ||||
142 | croak ((caller(0))[3] . ": instance method invoked on class") unless ref $self; | ||||
143 | return $self; | ||||
144 | } | ||||
145 | |||||
146 | =pod | ||||
147 | |||||
148 | =back | ||||
149 | |||||
150 | =cut | ||||
151 | |||||
152 | 1 | 2µs | 1; |