2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

92_FileLog.pm: prefer REGEXP eq NAME over fakelog (Forum #122372)

git-svn-id: https://svn.fhem.de/fhem/trunk@24849 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-08-14 09:49:09 +00:00
parent c0dd7bf522
commit 49b2184cf2
2 changed files with 6 additions and 4 deletions

View File

@ -416,11 +416,12 @@ FileLog_Set($@)
my ($hash, @a) = @_;
my $me = $hash->{NAME};
return undef if( $hash->{REGEXP} eq 'fakelog' );
return "no set argument specified" if(int(@a) < 2);
my %sets = (reopen=>0, clear=>0, absorb=>1, addRegexpPart=>2,
removeRegexpPart=>1);
%sets = (clear=>0) # 95351
if($hash->{REGEXP} eq 'fakelog' || # deprecated
$hash->{REGEXP} eq $me); # 122373
my $cmd = $a[1];
if(!defined($sets{$cmd})) {
@ -558,7 +559,8 @@ FileLog_fhemwebFn($$$$)
}
$ret .= "</table>";
return $ret if($pageHash);
return $ret if( $defs{$d}{REGEXP} eq 'fakelog' );
return $ret if($defs{$d}{REGEXP} eq 'fakelog'); # deprecated
return $ret if($defs{$d}{REGEXP} eq $d);
# DETAIL only from here on
my $hash = $defs{$d};

View File

@ -6,7 +6,7 @@ attr global statefile ./log/fhem.save
define WEB FHEMWEB 8083 global
# Fake FileLog entry, to access the fhem log from FHEMWEB
define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
define Logfile FileLog ./log/fhem-%Y-%m.log Logfile
define autocreate autocreate
attr autocreate filelog ./log/%NAME-%Y.log