8. incoming messages for users will now send a 'new message' message (instead
[spider.git] / perl / DXDebug.pm
index e19f309ca76cddb7285ed6b2aefa8aa7e2bfe1a7..64ed843944d7d478c4466f541933e75bca0af418 100644 (file)
@@ -25,6 +25,17 @@ use Carp;
 %dbglevel = ();
 $fp = DXLog::new('debug', 'dat', 'd');
 
+# add sig{__DIE__} handling
+if (!defined $DB::VERSION) {
+       $SIG{__WARN__} = $SIG{__DIE__} = sub { 
+               my $t = time; 
+               for (@_) {
+                       $fp->writeunix($t, "$t^$_"); 
+#                      print STDERR $_;
+               }
+       };
+}
+
 sub dbg
 {
        my $l = shift;