Sys::Syslog::OO - Thin object-oriented wrapper around Sys::Syslog::OO
package My::Cool::Package; 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' => 'mycoolprogram', 'facility' => $facility }); # ... other initialization code ... return $self; }
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.
Special thanks to Mike Fischer, Jason Livingood, and Comcast for allowing me to contribute this code to the OSS community.
Max Schubert <maxschube@cpan.org>
Copyright (C) 2009 by Max Schubert / 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.
To install Sys::Syslog::OO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::Syslog::OO
CPAN shell
perl -MCPAN -e shell install Sys::Syslog::OO
For more information on module installation, please visit the detailed CPAN module installation guide.