# Module id = Log::Log4perl INST_VERSION 0.37 # Module id = HTML::Mason INST_VERSION 1.23 # This is perl, v5.6.1 built for i386-linux # Server version: Apache/1.3.23 (Unix) (Red-Hat/Linux) package MyLogger; use Log::Log4perl; Log::Log4perl->init("/opt/app/log4perl.conf"); my ($log, $module_name); sub new { my MyLogger $self = shift; unless (ref $self) { $self = fields::new ($self); } $module_name = shift; $log = Log::Log4perl->get_logger($module_name); # compensate for this wrapper class by adding 1 $Log::Log4perl::caller_depth++; return $self; } sub debug{ my ($self, $logmsg) = @_; $log->debug($logmsg) if ($log->is_debug()); }