« 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
| |||||||||||
| 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
| |||||||||||
| 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; | |||||||||