[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack Trace






On Mon, May 19, 2014 at 2:19 PM, <..hidden..> wrote:
Dear Ledgersmb developers in order for me to debug applications I use a
what I call a 'stack trace'. To do this in Ledgersmb I have some code in
the beginning of every subroutine  like so:

if ( ${LedgerSMB::Sysconfig::debug} ) {
        open FILE, '>>', "../debug.txt";
        my $debug_sub  = ( caller(0) )[3],;
        my $debug_file = __FILE__,;
        $debug_sub =~ s/.*:://g;
        print FILE __FILE__, " sub $debug_sub Line: ", __LINE__, "\n";
        print FILE "Caller: ", caller, "\n\n";
        close FILE;
    }

In Form.pm, User.pm or other frequently hit files I will add varying
levels if ( ${LedgerSMB::Sysconfig::debug} > 2 )

I end up with a file that steps through the program like so:
arap.pl 1310 continue
mainmenu.pl191

pe.pl  1138 sub project_report
mainbin/arap.pl1314
LedgerSMB/PE.pm sub projects Line: 45
Caller: mainbin/pe.pl1146

Is there any easier way to achieve this in 1.4?
Cheers
Turtle


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel



--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.
http://www.efficito.com/learn_more
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel