[Bio] / FigKernelPackages / Tracer.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Tracer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.112, Wed Oct 1 03:23:40 2008 UTC revision 1.113, Thu Oct 9 17:59:52 2008 UTC
# Line 1693  Line 1693 
1693      $options->{user} = [$tkey, "tracing key"];      $options->{user} = [$tkey, "tracing key"];
1694      $options->{background} = [0, "spool standard and error output"];      $options->{background} = [0, "spool standard and error output"];
1695      $options->{warn} = [0, "send errors to RSS feed"];      $options->{warn} = [0, "send errors to RSS feed"];
1696        $options->{moreTracing} = ["", "comma-delimited list of additional trace modules for debugging"];
1697      # Create a parsing hash from the options hash. The parsing hash      # Create a parsing hash from the options hash. The parsing hash
1698      # contains the default values rather than the default value      # contains the default values rather than the default value
1699      # and the description. While we're at it, we'll memorize the      # and the description. While we're at it, we'll memorize the
# Line 1709  Line 1710 
1710      my ($retOptions, @retParameters) = ParseCommand(\%parseOptions, @argv);      my ($retOptions, @retParameters) = ParseCommand(\%parseOptions, @argv);
1711      # Get the logfile suffix.      # Get the logfile suffix.
1712      my $suffix = $retOptions->{user};      my $suffix = $retOptions->{user};
1713      # Check for background mode.      # We'll put the trace file name in here. We need it later if background
1714      if ($retOptions->{background}) {      # mode is on.
1715          my $outFileName = "$FIG_Config::temp/out$suffix$$.log";      my $traceFileName;
         my $errFileName = "$FIG_Config::temp/err$suffix$$.log";  
         open STDOUT, ">$outFileName";  
         open STDERR, ">$errFileName";  
         # Check for phone support. If we have phone support and a phone number,  
         # we want to turn it on.  
         if ($ENV{PHONE} && defined($FIG_Config::phone)) {  
             $retOptions->{phone} = $ENV{PHONE};  
         }  
     }  
1716      # Now we want to set up tracing. First, we need to know if the user      # Now we want to set up tracing. First, we need to know if the user
1717      # wants emergency tracing.      # wants emergency tracing.
1718      if ($retOptions->{trace} eq 'E') {      if ($retOptions->{trace} eq 'E') {
# Line 1736  Line 1728 
1728          }          }
1729          # Add the default categories.          # Add the default categories.
1730          push @cats, "Tracer";          push @cats, "Tracer";
1731            # Check for more tracing groups.
1732            if ($retOptions->{moreTracing}) {
1733                push @cats, split /,/, $retOptions->{moreTracing};
1734            }
1735          # Next, we create the category string by joining the categories.          # Next, we create the category string by joining the categories.
1736          my $cats = join(" ", @cats);          my $cats = join(" ", @cats);
1737          # Check to determine whether or not the caller wants to turn off tracing          # Check to determine whether or not the caller wants to turn off tracing
# Line 1774  Line 1770 
1770          # Now set up the tracing.          # Now set up the tracing.
1771          TSetup("$traceLevel $cats", $traceMode);          TSetup("$traceLevel $cats", $traceMode);
1772      }      }
1773        # Check for background mode.
1774        if ($retOptions->{background}) {
1775            my $outFileName = "$FIG_Config::temp/out$suffix$$.log";
1776            my $errFileName = "$FIG_Config::temp/err$suffix$$.log";
1777            # Spool the output.
1778            open STDOUT, ">$outFileName";
1779            # If we have a trace file, trace the errors to the log. Otherwise,
1780            # spool the errors.
1781            if (defined $traceFileName) {
1782                open STDERR, "| Tracer $traceFileName";
1783            } else {
1784                open STDERR, ">$errFileName";
1785            }
1786            # Check for phone support. If we have phone support and a phone number,
1787            # we want to turn it on.
1788            if ($ENV{PHONE} && defined($FIG_Config::phone)) {
1789                $retOptions->{phone} = $ENV{PHONE};
1790            }
1791        }
1792      # Check for the "help" option. If it is specified, dump the command-line      # Check for the "help" option. If it is specified, dump the command-line
1793      # options and exit the program.      # options and exit the program.
1794      if ($retOptions->{help}) {      if ($retOptions->{help}) {

Legend:
Removed from v.1.112  
changed lines
  Added in v.1.113

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3