diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index 26b83c77e..c945dc5b4 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -100,6 +100,9 @@ FileLog_Log($$) my $max = int(@{$dev->{CHANGED}}); my $tn = TimeNow(); my $ct = $dev->{CHANGETIME}; + my $wrotesome; + my $fh = $log->{FH}; + for (my $i = 0; $i < $max; $i++) { my $s = $dev->{CHANGED}[$i]; $s = "" if(!defined($s)); @@ -109,12 +112,14 @@ FileLog_Log($$) FileLog_Switch($log); - my $fh = $log->{FH}; print $fh "$t $n $s\n"; - $fh->flush; - $fh->sync if !($^O eq 'MSWin32'); #not implemented in Windows + $wrotesome = 1; } } + if($wrotesome) { + $fh->flush; + $fh->sync if !($^O eq 'MSWin32'); #not implemented in Windows + } return ""; } @@ -513,11 +518,11 @@ seekTo($$$$)
%d
day of month (01..31)%m
month (01..12)%Y
year (1970...)
- %w
day of week (0..6); 0 represents Sunday
- %j
day of year (001..366)
- %U
week number of year with Sunday as first day of week (00..53)
- %W
week number of year with Monday as first day of week (00..53)
+ %Y
year (1970...)%w
day of week (0..6); 0 represents Sunday%j
day of year (001..366)%U
week number of year with Sunday as first day of week (00..53)%W
week number of year with Monday as first day of week (00..53)%L
by the value of the global logdir attribute.%V
for ISO 8601 week numbers check if it is