IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 8, 2011, 2:12:04 PM (15 years ago)
Author:
bills
Message:

Added method redirect_to_logfile to PS::IPP::Config class. This checks for an existing log file.
If found renames it by appending a date string, then redirects STDOUT and STDERR to the new log file.
The name of the renamed file is included in the log.
In chip_imfile.pl use the new function and stop passing the -log parameter to ppImage. This should
lead to a consistent log output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/chip_imfile.pl

    r32355 r32374  
    4444my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
    4545     $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned );
    46 
    47 my $zaplog = 0;
    4846
    4947GetOptions(
     
    6563    'no-op'             => \$no_op,     # Don't do any operations?
    6664    'redirect-output'   => \$redirect,
    67     'zaplog'            => \$zaplog,
    6865    'save-temps'        => \$save_temps, # Save temporary files?
    6966    ) or pod2usage( 2 );
     
    9289}
    9390
    94 my ($logDest, $traceDest);
     91my ($logRule, $traceDest);
    9592if ($run_state eq 'new') {
    96     $logDest = prepare_output("LOG.IMFILE", $outroot, $class_id, $zaplog);
     93    $logRule = "LOG.IMFILE";
    9794    $traceDest = prepare_output("TRACE.IMFILE",  $outroot, $class_id, 1);
    9895} else {
    99     $logDest = prepare_output("LOG.IMFILE.UPDATE", $outroot, $class_id, 1);
     96    $logRule = "LOG.IMFILE.UPDATE";
    10097    $traceDest = prepare_output("TRACE.IMFILE.UPDATE",  $outroot, $class_id, 1);
    10198}
    10299
    103100if ($redirect) {
    104     $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR );
     101    my $logDest = $ipprc->filename($logRule, $outroot, $class_id);
     102
     103    $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR );
     104
    105105    print STDOUT "\n\n";
    106106    print STDOUT "Starting script $0 on $host\n\n";
     
    451451    $command .= " -image_id $chip_imfile_id" if defined $chip_imfile_id;
    452452    $command .= " -source_id $source_id" if defined $source_id;
    453     $command .= " -tracedest $traceDest -log $logDest";
     453    $command .= " -tracedest $traceDest";
    454454    $command .= " -dbname $dbname" if defined $dbname;
    455455
Note: See TracChangeset for help on using the changeset viewer.