2016-06-02 23:20:36 +02:00
|
|
|
package Lemonldap::NG::Common::Module;
|
2016-03-29 23:09:55 +02:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Mouse;
|
|
|
|
|
|
|
|
our $VERSION = '2.0.0';
|
|
|
|
|
2017-02-15 07:41:50 +01:00
|
|
|
# Object that provides loggers and error methods (typically PSGI object)
|
2016-12-26 10:23:35 +01:00
|
|
|
has p => ( is => 'rw', weak_ref => 1 );
|
2016-06-02 23:20:36 +02:00
|
|
|
|
|
|
|
# Lemonldap::NG configuration hash ref
|
2016-03-29 23:09:55 +02:00
|
|
|
has conf => ( is => 'rw', weak_ref => 1 );
|
|
|
|
|
2020-04-23 12:00:11 +02:00
|
|
|
has logger => ( is => 'rw', lazy => 1, default => sub { $_[0]->{p}->logger } );
|
|
|
|
has userLogger =>
|
|
|
|
( is => 'rw', lazy => 1, default => sub { $_[0]->{p}->userLogger } );
|
2016-03-29 23:09:55 +02:00
|
|
|
|
|
|
|
sub error {
|
|
|
|
my $self = shift;
|
|
|
|
return $self->p->error(@_);
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|