From 10cbbe025fe6a601575df51e3b075ad67c055276 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 19 Oct 2015 15:48:16 +0000 Subject: [PATCH] 92_FileLog.pm: update currentlogfile for fakelogs (Forum #42415) git-svn-id: https://svn.fhem.de/fhem/trunk@9539 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/92_FileLog.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index 958c3bc73..34bac2fcd 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -22,6 +22,7 @@ use vars qw(%FW_pos); # scroll position use vars qw(%FW_webArgs); # all arguments specified in the GET sub FileLog_seekTo($$$$$); +sub FileLog_dailySwitch($); ##################################### sub @@ -49,9 +50,22 @@ FileLog_Initialize($) InternalTimer(time()+0.1, sub() { # Forum #39792 map { HandleArchiving($defs{$_},1) } devspec2array("TYPE=FileLog"); + FileLog_dailySwitch($hash); # Forum #42415 }, $hash, 0); } +sub +FileLog_dailySwitch($) +{ + my ($hash) = @_; + map { FileLog_Switch($defs{$_}) } devspec2array("TYPE=FileLog"); + + my $t = time(); + $t = 86400*(int($t/86400)+1)+1-fhemTzOffset($t); # tomorrow, 1s after midnight + InternalTimer($t, "FileLog_dailySwitch", $hash, 0); +} + + ##################################### sub