summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjasonjayr <jasonjayr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-19 12:36:34 +0000
committerjasonjayr <jasonjayr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-19 12:36:34 +0000
commitfc64714f04d5018ba251f3cbfa98cbaf0f94adb6 (patch)
tree876ca0050922bfa56fe3727357c394b7e8358f0e
parent589184f26151de0de6df0a14262159ff87ed1e61 (diff)
Added support for full stack backtrace, via Carp
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@749 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/Log.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/LedgerSMB/Log.pm b/LedgerSMB/Log.pm
index f816660b..558578ec 100644
--- a/LedgerSMB/Log.pm
+++ b/LedgerSMB/Log.pm
@@ -31,6 +31,14 @@ Available methods: (in order, most to least severe)
=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 warnings;
use IO::File;
use Data::Dumper;
use LedgerSMB::Sysconfig;
+use Carp ();
our $fh;
@@ -76,11 +85,14 @@ sub warn { shift->print('warn',@_) }
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([@_]);
$d->Sortkeys(1);
- $self->print('dump',$d->Dump());
+ $self->print('debug',$d->Dump());
}
1;