From 9f90c98f505593b36e0fc8b6dfed7b1036c44a70 Mon Sep 17 00:00:00 2001 From: Maurice Hendrix <mh18@sanger.ac.uk> Date: Tue, 1 Mar 2011 11:48:45 +0000 Subject: [PATCH] now uses log_base_path option. If not set, logfil;e & logpath work as previously --- .../Bio/EnsEMBL/Utils/ConversionSupport.pm | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/Bio/EnsEMBL/Utils/ConversionSupport.pm b/modules/Bio/EnsEMBL/Utils/ConversionSupport.pm index 6491ab9912..9b67e40e54 100644 --- a/modules/Bio/EnsEMBL/Utils/ConversionSupport.pm +++ b/modules/Bio/EnsEMBL/Utils/ConversionSupport.pm @@ -120,6 +120,7 @@ sub parse_common_options { 'logfile|log=s', 'nolog|nolog=s', 'logpath=s', + 'log_base_path=s', 'logappend|log_append=s', 'verbose|v=s', 'interactive|i=s', @@ -160,16 +161,18 @@ sub parse_common_options { map { $self->param($_, $h{$_}) } keys %h; # if logpath & logfile are not se, set them here to /ensemblweb/vega_dev/shared/logs/conversion/DBNAME/SCRIPNAME_NN.log - if (not (defined($self->param('logpath')))){ - $self->param('logpath', "/ensemblweb/vega_dev/shared/logs/conversion/".$self->param('dbname')."/" ); - } - if ( (not defined $self->param('logfile') ) && (not defined $self->param('nolog') ) ){ - my $log = $Script; - $log =~ s/.pl//g; - my $counter; - for ($counter=1 ; (-e $self->param('logpath')."/".$log."_".sprintf("%03d", $counter).".log"); $counter++){ warn $self->param('logpath')."/".$log."_".$counter.".log";} - $self->param('logfile', $log."_".sprintf("%03d", $counter).".log"); + if (defined($self->param('log_base_path'))) { + if (not (defined($self->param('logpath')))){ + $self->param('logpath', $self->param('log_base_path')."/".$self->param('dbname')."/" ); + } + if ( (not defined $self->param('logfile') ) && (not defined $self->param('nolog') ) ){ + my $log = $Script; + $log =~ s/.pl//g; + my $counter; + for ($counter=1 ; (-e $self->param('logpath')."/".$log."_".sprintf("%03d", $counter).".log"); $counter++){ warn $self->param('logpath')."/".$log."_".$counter.".log";} + $self->param('logfile', $log."_".sprintf("%03d", $counter).".log"); + } } return(1); @@ -251,6 +254,7 @@ sub get_common_params { pass nolog logpath + log_base_path logfile logappend verbose -- GitLab