Filename | /usr/local/lib/site_perl/Log/Filter/Severity.pm |
Statements | Executed 14 statements in 298µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 12µs | 16µs | BEGIN@2 | Log::Filter::Severity::
1 | 1 | 1 | 9µs | 9µs | BEGIN@78 | Log::Filter::Severity::
1 | 1 | 1 | 8µs | 35µs | BEGIN@79 | Log::Filter::Severity::
1 | 1 | 1 | 7µs | 42µs | BEGIN@70 | Log::Filter::Severity::
1 | 1 | 1 | 7µs | 12µs | BEGIN@3 | Log::Filter::Severity::
1 | 1 | 1 | 5µs | 5µs | BEGIN@75 | Log::Filter::Severity::
1 | 1 | 1 | 2µs | 2µs | END | Log::Filter::Severity::
0 | 0 | 0 | 0s | 0s | _init | Log::Filter::Severity::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Log::Filter::Severity; | ||||
2 | 2 | 30µs | 2 | 19µs | # spent 16µs (12+3) within Log::Filter::Severity::BEGIN@2 which was called:
# once (12µs+3µs) by Log::Loger::BEGIN@123 at line 2 # spent 16µs making 1 call to Log::Filter::Severity::BEGIN@2
# spent 3µs making 1 call to strict::import |
3 | 2 | 63µs | 2 | 17µs | # spent 12µs (7+5) within Log::Filter::Severity::BEGIN@3 which was called:
# once (7µs+5µs) by Log::Loger::BEGIN@123 at line 3 # spent 12µs making 1 call to Log::Filter::Severity::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::Severity - Accepts messages coming with certain severities | ||||
14 | |||||
15 | =head1 SYNOPSIS | ||||
16 | |||||
17 | use Log::Filter::Severity; | ||||
18 | |||||
19 | my $filter = new Log::Filter::Severity('EMERG'); | ||||
20 | |||||
21 | my ($result, $continue) = $filter->accept($source, $severity, $message); | ||||
22 | |||||
23 | =head1 DESCRIPTION | ||||
24 | |||||
25 | This module accepts messages, whose SEVERITY value is in the given set | ||||
26 | of acceptable values. | ||||
27 | |||||
28 | There are two flags, that are altering the avaluation process, see | ||||
29 | Log::Filter::Set for details. | ||||
30 | |||||
31 | =head1 USAGE | ||||
32 | |||||
33 | =head1 BUGS | ||||
34 | |||||
35 | =head1 SUPPORT | ||||
36 | |||||
37 | =head1 AUTHOR | ||||
38 | |||||
39 | Jan Mach | ||||
40 | Cesnet, z.s.p.o | ||||
41 | jan.mach@cesnet.cz | ||||
42 | http://www.cesnet.cz | ||||
43 | |||||
44 | =head1 COPYRIGHT | ||||
45 | |||||
46 | This program is free software; you can redistribute | ||||
47 | it and/or modify it under the same terms as Perl itself. | ||||
48 | |||||
49 | The full text of the license can be found in the | ||||
50 | LICENSE file included with this module. | ||||
51 | |||||
52 | |||||
53 | =head1 SEE ALSO | ||||
54 | |||||
55 | perl(1). | ||||
56 | |||||
57 | =head1 FUNCTION REFERENCE | ||||
58 | |||||
59 | =over 4 | ||||
60 | |||||
61 | =cut | ||||
62 | |||||
63 | ################################################################################ | ||||
64 | # | ||||
65 | # INITIALIZATION AND CLEANUP SECTION | ||||
66 | # | ||||
67 | ################################################################################ | ||||
68 | |||||
69 | #-- Perl core modules ---------------------------------------------------------# | ||||
70 | 2 | 30µs | 2 | 76µs | # spent 42µs (7+34) within Log::Filter::Severity::BEGIN@70 which was called:
# once (7µs+34µs) by Log::Loger::BEGIN@123 at line 70 # spent 42µs making 1 call to Log::Filter::Severity::BEGIN@70
# spent 34µs making 1 call to Exporter::import |
71 | |||||
72 | #-- Perl CPAN modules ---------------------------------------------------------# | ||||
73 | |||||
74 | #-- Custom application modules ------------------------------------------------# | ||||
75 | 2 | 31µs | 1 | 5µs | # spent 5µs within Log::Filter::Severity::BEGIN@75 which was called:
# once (5µs+0s) by Log::Loger::BEGIN@123 at line 75 # spent 5µs making 1 call to Log::Filter::Severity::BEGIN@75 |
76 | |||||
77 | #-- Module initializations ----------------------------------------------------# | ||||
78 | # spent 9µs within Log::Filter::Severity::BEGIN@78 which was called:
# once (9µs+0s) by Log::Loger::BEGIN@123 at line 82 | ||||
79 | 2 | 31µs | 2 | 62µs | # spent 35µs (8+27) within Log::Filter::Severity::BEGIN@79 which was called:
# once (8µs+27µs) by Log::Loger::BEGIN@123 at line 79 # spent 35µs making 1 call to Log::Filter::Severity::BEGIN@79
# spent 27µs making 1 call to vars::import |
80 | 2 | 9µs | $VERSION = '0.01'; | ||
81 | @ISA = ('Log::Filter::Set'); | ||||
82 | 1 | 101µs | 1 | 9µs | } # spent 9µs making 1 call to Log::Filter::Severity::BEGIN@78 |
83 | |||||
84 | |||||
85 | #-- Module clean-up code (global destructor) ----------------------------------# | ||||
86 | 1 | 2µs | # spent 2µs within Log::Filter::Severity::END which was called:
# once (2µs+0s) by main::RUNTIME at line 0 of mentat.storage.mongo.pl | ||
87 | |||||
88 | } | ||||
89 | |||||
90 | ################################################################################ | ||||
91 | # | ||||
92 | # CONSTANTS AND GLOBAL VARIABLES DEFINITION SECTION | ||||
93 | # | ||||
94 | ################################################################################ | ||||
95 | |||||
96 | #-- Constants -----------------------------------------------------------------# | ||||
97 | |||||
98 | #-- Static public class variables (our) ---------------------------------------# | ||||
99 | |||||
100 | #-- Static protected class variables (my) -------------------------------------# | ||||
101 | |||||
102 | ################################################################################ | ||||
103 | # | ||||
104 | # IMPLEMENTATION SECTION | ||||
105 | # | ||||
106 | ################################################################################ | ||||
107 | |||||
108 | =item _init() [PROTECTED] | ||||
109 | |||||
110 | Usage : Used from constructor as follows: return $self->_init(@_); | ||||
111 | Purpose : Initialize newly created filter instance | ||||
112 | Returns : $self | ||||
113 | Arguments : space separated string|array reference $value_set - set of acceptable values | ||||
114 | string $flags - flags separated with spaces | ||||
115 | i - invert the result | ||||
116 | r - required | ||||
117 | Throws : Croaks, if invoked on class or invalid arguments given | ||||
118 | Comments : Internally used by parent`s new() method | ||||
119 | See Also : | ||||
120 | |||||
121 | =cut | ||||
122 | |||||
123 | sub _init { | ||||
124 | my $self = shift; | ||||
125 | croak ((caller(0))[3] . ": instance method invoked on class") unless ref $self; | ||||
126 | |||||
127 | return $self->SUPER::_init('severity', @_); | ||||
128 | } | ||||
129 | |||||
130 | =pod | ||||
131 | |||||
132 | =back | ||||
133 | |||||
134 | =cut | ||||
135 | |||||
136 | 1 | 2µs | 1; |