- my $self = shift;
- dbg("dxlog", "closing $self->{fn}\n");
- undef $self->{fh} if defined $self->{fh};
-}
+ foreach my $l (values %logs) {
+ $l->{fh}->flush if exists $l->{fh};
+ }
+}
+
+# log something in the system log
+# this routine is exported to any module that declares DXLog
+# it takes all its args and joins them together with the unixtime writes them out as one line
+# The user is responsible for making sense of this!
+sub Log
+{
+ my $t = $main::systime;
+ $log->writeunix($t, join('^', $t, @_) );
+}
+
+sub LogDbg
+{
+ DXDebug::dbg($_) for @_;
+ Log(@_);
+}
+
+sub Logclose
+{
+ $log->close();
+}