blib/lib/Lemonldap/NG/Common/AuditLogger/UserLoggerCompat.pm

filter: Statementstmt 100% 16 / 16 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 2 totaltotal 88.0% 22 / 25 CC 3 SCAR 5.9
CC
3
Cov
95%
new
2.0
log
2.0
BEGIN
1.0
CRAP 1.8
« blib/lib/Lemonldap/NG/Common/AuditLogger/UserLoggerJSON.pm ↑ Summary blib/lib/Lemonldap/NG/Common/Regexp.pm »
1 package Lemonldap::NG::Common::AuditLogger::UserLoggerCompat;
2  
3 2 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = '2.21.0';
6  
7 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
8 2 my ( $class, $psgi_or_handler ) = @_;
9 2 my $self = bless {}, $class;
10  
11 2 ▶ $self->{userLogger} = $psgi_or_handler->userLogger
Branch: 1 branch
BranchTrueFalseTotal
$self->{"userLogger"} = $psgi_or_handler->userLogger or die "Missing userLogger" 2 0 2
12 or die 'Missing userLogger';
13 2 weaken $self->{userLogger};
14 2 return $self;
15 }
16  
17 4 ▶sub log {
Subroutine log: called CC=2 SCAR=6.9
Pod undocumented
18 4 my ( $self, $req, %fields ) = @_;
19  
20 4 my $message = $fields{message};
21 4 ▶ if ( !$message ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($message) 2 2 4
22 2 my ( $module, $file, $line ) = caller(2);
23 2 $message =
24 "auditLogger internal error: no message provided at $file line $line";
25 }
26 4 $self->{userLogger}->notice($message);
27 }
28 2 1;
« blib/lib/Lemonldap/NG/Common/AuditLogger/UserLoggerJSON.pm ↑ Summary blib/lib/Lemonldap/NG/Common/Regexp.pm »