in reply to creating a wrapper class

package SomeClass; use strict; use Log::Log4perl; # do what I mean die "insert your code here"; 1;

something like this? what is your wrapper class supposed to provide?

--shmem

update: added 'use strict'

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: creating a wrapper class
by aroc725 (Acolyte) on Jul 17, 2006 at 15:10 UTC
    Thanks for responding. What I'd like to do is inherit from 'Log::Log4perl' and then override the 'error', 'info', etc. methods so I can include some extra information in the logged messages.
      See section on Inheritance in perltoot.

      Like this ...

      package MyClass; use strict; use Log::Log4Perl; # this tells perl to look in Log::Log4Perl for methods @MyClass::ISA = qw(Log::Log4Perl); # now override methods with your own ones. # all else is found looked up in packages in # @MyClass::ISA sub error { ... } sub info { ... } 1;

      ... or use the base pragma.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

      package MyLog; use base qw(Log::Log4Perl); ....

      /J\

        I'm getting this error message in the Netscape Web server 'errors' log file:

        ...mid_yr_rpt_survey.cgi did not produce a valid header (name without value: got line " (perhaps you need to 'use' the module which defines that package first.)")

        despite having this in the 'HinLog.pm' file:

        package mid_yr_rpt_survey::HinLog;

        use Log::Log4perl qw(get_logger); # don't need this, right?
        use base qw(Log::Log4Perl);

        and this in the 'DBI.pm' module that's trying to use 'HinLog':

        package mid_yr_rpt_survey::DBI; ...
        use mid_yr_rpt_survey::HinLog;