| 9 |
## ------------------------------------------------------------------------ |
## ------------------------------------------------------------------------ |
| 10 |
## |
## |
| 11 |
## $Log$ |
## $Log$ |
| 12 |
|
## Revision 1.20 2003/06/25 22:51:51 joko |
| 13 |
|
## + sub get_locator_type & Co. |
| 14 |
|
## |
| 15 |
## Revision 1.19 2003/02/18 19:22:11 joko |
## Revision 1.19 2003/02/18 19:22:11 joko |
| 16 |
## + fixed logging |
## + fixed logging |
| 17 |
## |
## |
| 152 |
my $method = $AUTOLOAD; |
my $method = $AUTOLOAD; |
| 153 |
$method =~ s/^.*:://; |
$method =~ s/^.*:://; |
| 154 |
|
|
| 155 |
|
#print __PACKAGE__, "\n"; |
| 156 |
|
#print $method, "\n"; |
| 157 |
|
#print $self->{locator}, "\n"; |
| 158 |
|
|
| 159 |
|
my $locator_type = $self->get_locator_type(); |
| 160 |
|
|
| 161 |
# advanced logging of AUTOLOAD calls ... |
# advanced logging of AUTOLOAD calls ... |
| 162 |
# ... nice but do it only when TRACING (TODO) is enabled |
# ... nice but do it only when TRACING (TODO) is enabled |
| 163 |
my $logstring = ""; |
my $logstring = ""; |
| 164 |
$logstring .= __PACKAGE__ . "[$self->{locator}->{type}]" . "->" . $method; |
$logstring .= __PACKAGE__ . "[$locator_type]" . "->" . $method; |
| 165 |
#print "count: ", $#_, "\n"; |
#print "count: ", $#_, "\n"; |
| 166 |
#$logstring .= Dumper(@_) if ($#_ != -1); |
#$logstring .= Dumper(@_) if ($#_ != -1); |
| 167 |
my $tabcount = int( (80 - length($logstring)) / 10 ); |
my $tabcount = int( (80 - length($logstring)) / 10 ); |
| 181 |
if ($self->{STORAGEHANDLE}) { |
if ($self->{STORAGEHANDLE}) { |
| 182 |
return $self->{STORAGEHANDLE}->$method(@_); |
return $self->{STORAGEHANDLE}->$method(@_); |
| 183 |
} else { |
} else { |
| 184 |
$logger->critical( __PACKAGE__ . "->AUTOLOAD: ERROR: " . $logstring ); |
my $msg = __PACKAGE__ . "->AUTOLOAD: ERROR: " . $logstring; |
| 185 |
|
$logger->critical( $msg ) if $logger; |
| 186 |
|
print STDERR $msg if not $logger; |
| 187 |
return; |
return; |
| 188 |
} |
} |
| 189 |
} |
} |
| 242 |
|
|
| 243 |
sub _createStorageHandle { |
sub _createStorageHandle { |
| 244 |
my $self = shift; |
my $self = shift; |
| 245 |
my $type = $self->{locator}->{type}; |
|
| 246 |
|
# 2003-06-18: protection against storagehandles w/o locators |
| 247 |
|
return if not defined $self->{locator}; |
| 248 |
|
|
| 249 |
|
my $type = $self->get_locator_type(); |
| 250 |
$logger->debug( __PACKAGE__ . "[$type]" . "->_createStorageHandle()" ); |
$logger->debug( __PACKAGE__ . "[$type]" . "->_createStorageHandle()" ); |
| 251 |
|
|
| 252 |
#print Dumper($self); |
#print Dumper($self); |
| 313 |
$logger->remove($name); |
$logger->remove($name); |
| 314 |
} |
} |
| 315 |
|
|
| 316 |
|
sub get_locator_type { |
| 317 |
|
my $self = shift; |
| 318 |
|
my $locator_type = ''; |
| 319 |
|
$locator_type = $self->{locator}->{type} if defined $self->{locator}; |
| 320 |
|
return $locator_type; |
| 321 |
|
} |
| 322 |
|
|
| 323 |
1; |
1; |
| 324 |
__END__ |
__END__ |