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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.300, Thu Jun 23 21:24:48 2005 UTC revision 1.301, Fri Jun 24 21:39:14 2005 UTC
# Line 137  Line 137 
137  This is the constructor for a FIG object. It uses no parameters. If tracing  This is the constructor for a FIG object. It uses no parameters. If tracing
138  has not yet been turned on, it will be turned on here. The tracing type and  has not yet been turned on, it will be turned on here. The tracing type and
139  level are specified by the configuration variables C<$FIG_Config::trace_levels>  level are specified by the configuration variables C<$FIG_Config::trace_levels>
140  and C<$FIG_Config::trace_type>. In a future release, the code will be modified  and C<$FIG_Config::trace_type>. These defaults can be overridden using the
141  to allow overriding the configuration variables with environment variables.  environment variables C<Trace> and C<TraceType>, respectively.
142    
143  =cut  =cut
144    
# Line 156  Line 156 
156          my $figrpc = new FIGrpc($ENV{FIG_URL});          my $figrpc = new FIGrpc($ENV{FIG_URL});
157          return $figrpc;          return $figrpc;
158      }      }
     if (exists($ENV{Trace}))  
     {  
         my $trace_type = (defined $FIG_Config::trace_type ? $FIG_Config::trace_type : "WARN");  
         TSetup($ENV{Trace}, $trace_type);  
     }  
159      # Here we have the normal case. Check for default tracing. We only do this if      # Here we have the normal case. Check for default tracing. We only do this if
160      # the proper parameters are present and nobody else has set up tracing yet.      # the proper parameters are present and nobody else has set up tracing yet.
161      if (exists($ENV{Trace}))      if (Tracer::Setups() == 0 && (defined $FIG_Config::trace_levels || exists $ENV{Trace})) {
162      {          # Tracing is not active and the user has specified tracing levels, so it's safe for
163          my $trace_type = (defined $FIG_Config::trace_type ? $FIG_Config::trace_type : "WARN");          # us to set it up using our own rules. First, the trace type: the default is WARN.
164          TSetup($ENV{Trace}, $trace_type);          my $trace_type;
165            if (exists($ENV{TraceType})) {
166                $trace_type = $ENV{TraceType};
167            } elsif (defined($FIG_Config::trace_type)) {
168                $trace_type = $FIG_Config::trace_type;
169            } else {
170                $trace_type = "WARN";
171      }      }
172      elsif (defined($FIG_Config::trace_levels) && Tracer::Setups() == 0) {          # Now the trace levels. The environment variable wins over the FIG_Config value.
173          # It's on, so we set it up. If the type is omitted, we default to WARN, which          my $trace_levels = (exists($ENV{Trace}) ? $ENV{Trace} : $FIG_Config::trace_levels);
174          # is the standard error output.          TSetup($trace_levels, $trace_type);
         my $trace_type = (defined $FIG_Config::trace_type ? $FIG_Config::trace_type : "WARN");  
         TSetup($FIG_Config::trace_levels, $trace_type);  
175      }      }
176      # Connect to the database, then return ourselves.      # Connect to the database, then return ourselves.
177      my $rdbH = new DBrtns;      my $rdbH = new DBrtns;

Legend:
Removed from v.1.300  
changed lines
  Added in v.1.301

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3