[Koha-devel] A solution to add debugger functionality to most koha *.pl scripts, thoughts please?

John Beppu john.beppu at liblime.com
Tue Feb 10 07:30:02 CET 2009


Give C4::Debug an import() function like this:

sub import {
        if ($debug) {
                require Smart::Comments;
                Smart::Comments->import;
                require Data::Dumper;
                Data::Dumper->import;
        }
        C4::Debug->export_to_level(1, @_);
}

That should do the trick.

On Mon, Feb 9, 2009 at 9:11 PM, Mason James <mason.loves.sushi at gmail.com>wrote:

>
> On 2009/02/10, at 6:01 PM, Mason James wrote:
>
> > Hi Koha developers,
> >
> > I have been talking with John and Paul at BibLibre for some months
> > now about a
> > correct way to add Data::Dumper, Smart::Comments,
> > insert::your::favorite::debugger stuff
> > to the Koha perl files *once and for all*
> >
> >
> > After a few false starts and some googling - this is the method I
> > have used and tested...
> >
> >
> > use C4::Debug;
> > use if $debug, 'Data::Dumper' ;
> > use if $debug, 'Smart::Comments' ;
> > # use if $debug, 'YAML::Dumper;   # etc....
> >
>
> > Is there a better way than this?
>
>
> A question from me too..
>
> Is there a clever way to add this code to *just* Debug.pm which would
> enable D::D and S::C functionality to all perl files that 'use
> C4::Debug'?
>
> That would be the cleanest way, i think - but i don't know how to do
> this, or if it's possible in perl :/
>
> anyone?
>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha.org
> http://lists.koha.org/mailman/listinfo/koha-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20090209/ccc153c8/attachment-0002.htm>


More information about the Koha-devel mailing list