]> git.donarmstrong.com Git - infobot.git/commitdiff
make the log messages more useful
authordondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 29 Apr 2008 05:50:09 +0000 (05:50 +0000)
committerdondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 29 Apr 2008 05:50:09 +0000 (05:50 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/don/dpkg@1815 c11ca15a-4712-0410-83d8-924469b57eb5

src/logger.pl

index fd3d6a7d02f0582234dfdfead1a544099db11469..e23e69d380d6fe65b00ec177b635b0ef2d27fe60 100644 (file)
@@ -170,12 +170,15 @@ sub compress {
 
 sub DEBUG {
     return unless ( &IsParam('DEBUG') );
+    my (undef,undef,$line,$subroutine,undef) = caller(0);
 
-    &status("${b_green}!DEBUG!$ob $_[0]");
+    &status("${b_green}!DEBUG!$ob ".$subroutine.'['.$line."] $_[0]");
 }
 
 sub ERROR {
-    &status("${b_red}!ERROR!$ob $_[0]");
+    my (undef,undef,$line,$subroutine,undef) = caller(0);
+
+    &status("${b_red}!ERROR!$ob ".$subroutine.'['.$line."] $_[0]");
 }
 
 sub WARN {
@@ -183,15 +186,21 @@ sub WARN {
 
     return if ( $_[0] =~ /^PERL: Subroutine \S+ redefined at/ );
 
-    &status("${b_yellow}!WARN!$ob $_[0]");
+    my ($package,$filename,$line,$subroutine,undef) = caller(0);
+
+    &status("${b_yellow}!WARN!$ob ".$subroutine.'['.$line."] $_[0]");
 }
 
 sub FIXME {
-    &status("${b_cyan}!FIXME!$ob $_[0]");
+    my ($package,$filename,$line,$subroutine,undef) = caller(0);
+
+    &status("${b_cyan}!FIXME!$ob ".$subroutine.'['.$line."] $_[0]");
 }
 
 sub TODO {
-    &status("${b_cyan}!TODO!$ob $_[0]");
+    my ($package,$filename,$line,$subroutine,undef) = caller(0);
+
+    &status("${b_cyan}!TODO!$ob ".$subroutine.'['.$line."] $_[0]");
 }
 
 sub VERB {