I agree, but couldn't figure out how to do that. I figured it was best to
have a working example first, then tidy up later. Can you point to an
example I can use?
On Oct 18, 2013 1:43 AM, "Kevin Robert Keegan" <notifications@github.com>
wrote:

> In lib/Insteon/BaseInterface.pm:
>
> > +=item C<debuglevel([level])>
> > +
> > +Returns 1 if Insteon or this device is at least debug level 'level', otherwise returns 0.
> > +
> > +=cut
> > +
> > +sub debuglevel
> > +{
> > +	my ($self, $debug_level) = @_;
> > +	$debug_level = 1 unless $debug_level;
> > +	my $objname = lc $self->get_object_name;
> > +	&::print_log("debuglevel: Processing debug for object $objname ... " . $main::Debug{$objname}) if $main::Debug{insteon} >= 5;
> > +	return 1 if $main::Debug{insteon} >= $debug_level;
> > +	return 1 if $main::Debug{$objname} >= $debug_level;
> > +  return 0;
> > + }
>
> Rather than duplicate the code here, we may want to just pass this to the
> BaseObject, that way the code wont diverge if it is later modified.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/hollie/misterhouse/pull/288/files#r7054416>
> .
>