Saftpresse/Plugin/LimitProgram.pm

filter: Statementstmt 50.0% 7 / 14 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 42.8% 9 / 21 SCAR 16.2
CC
3
Cov
39%
process
12.0
BEGIN
1.0
CRAP 5.1
« Saftpresse/Plugin/Postfix.pm ↑ Summary Saftpresse/Input/Stdin.pm »
1 package Log::Saftpresse::Plugin::LimitProgram;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: plugin to limit messages by syslog program name
6 1 our $VERSION = '1.5'; # VERSION
7  
8 1 extends 'Log::Saftpresse::Plugin';
9  
10 1 has 'regex' => ( is => 'rw', isa => 'Str', required => 1 );
11  
12 sub process {
13 0 ▶ my ( $self, $stash ) = @_;
Subroutine process: not called CC=3 SCAR=24.8
Pod documented
14 0 my $regex = $self->regex;
15  
16 0 ▶ if( ! defined $stash->{'program'} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $stash->{"program"}) 0 0 0
17 0 return;
18 }
19 0 ▶ if( $stash->{'program'} !~ /$regex/ ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($stash->{"program"} =~ /$regex/) 0 0 0
20 0 return('next');
21 }
22
23 0 return;
24 }
25  
26 1 1;
27  
28 __END__
29  
30 =pod
31  
32 =encoding UTF-8
33  
34 =head1 NAME
35  
36 Log::Saftpresse::Plugin::LimitProgram - plugin to limit messages by syslog program name
37  
38 =head1 VERSION
39  
40 version 1.5
41  
42 =head1 AUTHOR
43  
44 Markus Benning <ich@markusbenning.de>
45  
46 =head1 COPYRIGHT AND LICENSE
47  
48 This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning.
49  
50 This is free software, licensed under:
51  
52 The GNU General Public License, Version 2, June 1991
53  
54 =cut
« Saftpresse/Plugin/Postfix.pm ↑ Summary Saftpresse/Input/Stdin.pm »