/usr/share/perl5/Catmandu/Fix/log.pm is in libcatmandu-perl 0.9206-1.
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 | =head1 NAME
Catmandu::Fix::log - Log::Any logger as fix
=head1 SYNOPSIS
log('test123');
log('hello world' , level => 'DEBUG');
=head1 SEE ALSO
L<Catmandu::Fix>
=cut
package Catmandu::Fix::log;
use Moo;
use Catmandu;
use Catmandu::Fix::Has;
with 'Catmandu::Logger';
has message => (fix_arg => 1);
has level => (fix_opt => 1);
sub fix {
my ($self,$data) = @_;
my $id = $data->{_id} // '<undef>';
my $level = $self->level // 'INFO';
if ($level =~ /^(trace|debug|info|notice|warn|error|critical|alert|emergency)$/i) {
my $lvl = lc $level;
$self->log->$lvl(sprintf "%s : %s\n" , $id , $self->message);
}
$data;
}
1;
|