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