X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXLog.pm;h=785483533c562f50dfc438e30ecfebfda9cf024b;hb=9e5520826fe61fd3ac6941f2b8bf736a432eaa15;hp=22f8c808307ce3b4b3fe61f8ce0b6a70a502dd29;hpb=dbf7523a9b228dbdf1d03109afde351b8b194fab;p=spider.git diff --git a/perl/DXLog.pm b/perl/DXLog.pm index 22f8c808..78548353 100644 --- a/perl/DXLog.pm +++ b/perl/DXLog.pm @@ -27,7 +27,7 @@ package DXLog; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(Log Logclose); +@EXPORT = qw(Log LogDbg Logclose); use IO::File; use DXVars; @@ -99,7 +99,7 @@ sub open $fh->autoflush(1) if $mode ne 'r'; # make it autoflushing if writable $self->{fh} = $fh; -# DXDebug::dbg("opening $self->{fn}\n") if isdbg("dxlog"); +# print "opening $self->{fn}\n"; return $self->{fh}; } @@ -155,7 +155,7 @@ sub write($$$) if (!$self->{fh} || $self->{mode} ne ">>" || $jdate->year != $self->{jdate}->year || - $jdate->thing != $self->{jdate}->year) { + $jdate->thing != $self->{jdate}->thing) { $self->open($jdate, ">>") or confess "can't open $self->{fn} $!"; } @@ -204,6 +204,12 @@ sub Log $log->writeunix($t, join('^', $t, @_) ); } +sub LogDbg +{ + DXDebug::dbg($_[$#_]); + Log(@_); +} + sub Logclose { $log->close();