NAME
Sys::Syslog::OO - Thin object-oriented wrapper around Sys::Syslog
SYNOPSIS
package My::Class::With::Logging;
use Sys::Syslog::OO;
use base qw(Sys::Syslog::OO);
sub new {
my ($class, $cfg) = @_;
my $facility = 'LOG_LOCAL7';
if (exists $cfg->{'syslog_facility'}) {
$facility = $cfg->{'syslog_facility'};
}
my $self = $class->SUPER::new({'label' => 'mycoolclass',
'facility' => $facility });
# ... other initialization of your custom class ...
return $self;
}
DESCRIPTION
Thin OO-wrapper around Sys::Syslog. Why? Less chance of mis-typing log levels and less noisy code. Can also be used with multiple-inheritence to add logging to a new or existing class.
SEE ALSO
Sys::Syslog
AUTHOR
Max Schubert <maxschube@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2009 - Comcast
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.