require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(Log);
+@EXPORT = qw(Log Logclose);
use FileHandle;
use DXVars;
{
my $self = shift;
undef $self->{fh}; # close the filehandle
- delete $self->{fh};
+ delete $self->{fh};
+}
+
+sub DESTROY
+{
+ my $self = shift;
+ undef $self->{fh}; # close the filehandle
+ delete $self->{fh} if $self->{fh};
}
# log something in the system log
$log->writeunix($t, join('^', $t, @_) );
}
-sub DESTROY # catch undefs and do what is required further down the tree
+sub Logclose
{
- my $self = shift;
- DXDebug::dbg("dxlog", "closing $self->{fn}\n");
- undef $self->{fh} if defined $self->{fh};
-}
+ $log->close();
+}
1;