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

SF.net SVN: ledger-smb: [749] trunk/LedgerSMB/Log.pm



Revision: 749
          http://svn.sourceforge.net/ledger-smb/?rev=749&view=rev
Author:   jasonjayr
Date:     2006-12-19 04:36:34 -0800 (Tue, 19 Dec 2006)

Log Message:
-----------
Added support for full stack backtrace, via Carp

Modified Paths:
--------------
    trunk/LedgerSMB/Log.pm

Modified: trunk/LedgerSMB/Log.pm
===================================================================
--- trunk/LedgerSMB/Log.pm	2006-12-08 19:26:05 UTC (rev 748)
+++ trunk/LedgerSMB/Log.pm	2006-12-19 12:36:34 UTC (rev 749)
@@ -31,6 +31,14 @@
 
 =item debug
 
+=item longmess
+
+This uses Carp to make a debug message with the full stack backtrace, including function arguments, where Carp can infer them.
+
+=item dump
+
+This uses Data::Dumper to dump the contents of a data structure as a debug message.
+
 =back
 
 =cut
@@ -41,6 +49,7 @@
 use IO::File;
 use Data::Dumper;
 use LedgerSMB::Sysconfig;
+use Carp ();
 
 
 our $fh;
@@ -76,11 +85,14 @@
 sub notice { shift->print('notice',@_) }
 sub info { shift->print('info',@_) }
 sub debug { shift->print('debug',@_) }
+
+sub longmess { shift->print('debug',Carp::longmess(@_)) }
+
 sub dump { 
 	my $self = shift;
 	my $d = Data::Dumper->new(..hidden..);
 	$d->Sortkeys(1);
-	$self->print('dump',$d->Dump());
+	$self->print('debug',$d->Dump());
 }
 
 1;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.