/usr/share/perl5/Authen/Simple/Log.pm is in libauthen-simple-perl 0.4-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | package Authen::Simple::Log;
use strict;
use warnings;
use IO::Handle;
our $SINGLETON = bless( {}, __PACKAGE__ );
sub new { $SINGLETON }
sub debug { }
sub error { shift->_log( 'error', @_ ) }
sub info { }
sub warn { shift->_log( 'warn', @_ ) if $^W }
sub _caller {
my $self = shift;
my $frame = 0;
$frame++ until ( caller($frame) ne __PACKAGE__ );
return scalar caller($frame);
}
sub _format {
my ( $self, $level, @message ) = @_;
return sprintf( "[%s] [%s] [%s] %s\n", scalar localtime(), $level, $self->_caller, "@message" );
}
sub _output {
my $self = shift;
STDERR->print(@_);
STDERR->flush;
}
sub _log {
my $self = shift;
my $message = $self->_format(@_);
$self->_output($message);
}
1;
__END__
=head1 NAME
Authen::Simple::Log - Simple log class
=head1 SYNOPSIS
$log = Authen::Simple::Log->new;
$log->error($message);
$log->warn($message);
=head1 DESCRIPTION
Default log class for Authen::Simple
=head1 METHODS
=over 4
=item * new
Constructor, takes no parameters.
=item * debug (@)
Does nothing.
=item * error (@)
Logs a error message to C<STDERR>.
=item * info (@)
Does nothing.
=item * warn (@)
Logs a warning message to C<STDERR> if C<$^W> is true.
=back
=head1 SEE ALSO
L<Authen::Simple>
L<Authen::Simple::Adapter>
=head1 AUTHOR
Christian Hansen C<ch@ngmedia.com>
=head1 COPYRIGHT
This program is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
|