Index: trunk/tools/regpeek.pl
===================================================================
--- trunk/tools/regpeek.pl	(revision 30646)
+++ trunk/tools/regpeek.pl	(revision 30650)
@@ -2,4 +2,12 @@
 
 use DBI;
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+
+my $dbname = 'gpc1';
+
+GetOptions(
+    'logs|L'      => \$logs,
+    'dbname=s'    => \$dbname,
+    );
 
 my $date = shift(@ARGV);
@@ -19,16 +27,27 @@
 print "CheckStatus: $bad_exp\n";
 $bad_exp = (split /\s+/, $bad_exp)[0];
-print "Exposure: $bad_exp is the current problem\n";
+print "Exposure: $bad_exp is the current pending exposure.\n";
 
-my $dbname = 'gpc1';
+
 my $db = init_gpc_db();
 
-my $query = "select exp_name,class_id,burntool_state,data_state FROM rawImfile where exp_name = '$bad_exp'";
+my $query = "select exp_name,class_id,burntool_state,data_state,uri,exp_id FROM rawImfile where exp_name = '$bad_exp'";
 
 my $data  = $db->selectall_arrayref( $query );
-print "#exp_name   class_id   bt_state   data_state\n";
+print "#exp_name   class_id   bt_state   data_state uri\n";
 foreach my $row (@{ $data }) {
-    my ($exp_name,$class_id,$bt_state,$data_state) = @{ $row };
-    print "$exp_name  $class_id $bt_state $data_state\n";
+    my ($exp_name,$class_id,$bt_state,$data_state,$uri,$exp_id) = @{ $row };
+    print "$exp_name  $class_id $bt_state $data_state $uri\n";
+    if ($logs) {
+	$reg_log = $uri;
+	$reg_log =~ s/$exp_name/${exp_name}.${exp_id}/g;
+	$reg_log =~ s/ota/reg.ota/;
+	$reg_log =~ s/fits/log/;
+	$burn_log = $uri;
+	$burn_log =~ s/fits/burn.log/;
+	
+	print "           REG_LOG: $reg_log\n";
+	print "          BURN_LOG: $burn_log\n";
+    }
 }
 
