Random_Walk has asked for the wisdom of the Perl Monks concerning the following question:
Wise monks, and the rest ;)
I have a logging routine from a supplier that has the prototype ($$). The first parameter is the log level, the second the message to log. I am overriding this sub already to add a debug feature and all is good. Now I would like to change the prototype to ($@) and then convert the @ with a join before calling the original logger.
# Patch nimlog to echo to STDOUT in debug { no warnings qw(redefine); sub nimLog ($@) { my $msg = join ', ', @_; Nimbus::API::nimLog( $_[0], $msg ); say $msg if $main::debug and $main::setup->{loglevel} >= $_[1] +; } }
of course now I get the error Prototype mismatch. Is there a way to do this or should I just behave and use a new name for my new logger?
Thanks,
R.
Pereant, qui ante nos nostra dixerunt!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: override prototype
by ikegami (Patriarch) on Jan 25, 2010 at 16:45 UTC | |
by Random_Walk (Prior) on Jan 25, 2010 at 16:54 UTC | |
by ikegami (Patriarch) on Jan 25, 2010 at 17:27 UTC | |
by Random_Walk (Prior) on Jan 26, 2010 at 08:45 UTC | |
by ikegami (Patriarch) on Jan 26, 2010 at 16:10 UTC | |
Re: override prototype
by cdarke (Prior) on Jan 25, 2010 at 16:59 UTC |
Back to
Seekers of Perl Wisdom