mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 11:01:59 +00:00
fhem.pl: implement ignoreRegexp for the global FHEM log (Forum #104520)
git-svn-id: https://svn.fhem.de/fhem/trunk@20827 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
48bff22f9a
commit
90e6c462d2
@ -778,8 +778,8 @@ END
|
|||||||
<li>ignoreRegexp regexp<br>
|
<li>ignoreRegexp regexp<br>
|
||||||
Es ist nicht immer einfach ein Regexp zu bauen, was etwas _nicht_
|
Es ist nicht immer einfach ein Regexp zu bauen, was etwas _nicht_
|
||||||
matcht. Dieses Attribu hilft in diesen Fällen: das Event wird
|
matcht. Dieses Attribu hilft in diesen Fällen: das Event wird
|
||||||
ignoriert, falls den angegebenen Regexp. Syntax ist gleich wie in der
|
ignoriert, falls den angegebenen Regexp matcht. Syntax ist gleich wie
|
||||||
Definition.
|
in der Definition.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<a name="readLog"></a>
|
<a name="readLog"></a>
|
||||||
|
@ -1567,6 +1567,13 @@ The following local attributes are used by a wider range of devices:
|
|||||||
compression by default. Set httpcompress to 0 to disable this feature.
|
compression by default. Set httpcompress to 0 to disable this feature.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="ignoreRegexp"></a>
|
||||||
|
<li>ignoreRegexp<br>
|
||||||
|
Do not log messages matching the value into the FHEM log. Note: the
|
||||||
|
usual ^ and $ will be appended to the regexp, like in notify or
|
||||||
|
FileLog.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="keyFileName"></a>
|
<a name="keyFileName"></a>
|
||||||
<li>keyFileName<br>
|
<li>keyFileName<br>
|
||||||
FHEM modules store passwords and unique IDs in the file
|
FHEM modules store passwords and unique IDs in the file
|
||||||
|
@ -1671,6 +1671,13 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
|
|||||||
httpcompress auf 0 setzt, wird die Komprimierung deaktiviert.
|
httpcompress auf 0 setzt, wird die Komprimierung deaktiviert.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="ignoreRegexp"></a>
|
||||||
|
<li>ignoreRegexp<br>
|
||||||
|
Texte, wo dieses Regexp matcht, werden nicht geloggt. ^ und $ wird zum
|
||||||
|
Regexp hinzugefügt, wie bei notify und FileLog.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
|
||||||
<a name="keyFileName"></a>
|
<a name="keyFileName"></a>
|
||||||
<li>keyFileName<br>
|
<li>keyFileName<br>
|
||||||
FHEM Module speichern Passwörter und IDs in der Datei
|
FHEM Module speichern Passwörter und IDs in der Datei
|
||||||
|
@ -303,6 +303,7 @@ my @cmdList; # Remaining commands in a chain. Used by sleep
|
|||||||
my %sleepers; # list of sleepers
|
my %sleepers; # list of sleepers
|
||||||
my %delayedShutdowns; # definitions needing delayed shutdown
|
my %delayedShutdowns; # definitions needing delayed shutdown
|
||||||
my %fuuidHash; # for duplicate checking
|
my %fuuidHash; # for duplicate checking
|
||||||
|
my $ignoreRegexp; # for Log filtering
|
||||||
|
|
||||||
$init_done = 0;
|
$init_done = 0;
|
||||||
$lastDefChange = 0;
|
$lastDefChange = 0;
|
||||||
@ -338,6 +339,7 @@ my @globalAttrList = qw(
|
|||||||
genericDisplayType:switch,outlet,light,blind,speaker,thermostat
|
genericDisplayType:switch,outlet,light,blind,speaker,thermostat
|
||||||
holiday2we
|
holiday2we
|
||||||
httpcompress:0,1
|
httpcompress:0,1
|
||||||
|
ignoreRegexp
|
||||||
keyFileName
|
keyFileName
|
||||||
language:EN,DE
|
language:EN,DE
|
||||||
lastinclude
|
lastinclude
|
||||||
@ -969,6 +971,7 @@ Log3($$$)
|
|||||||
return if($loglevel > $attr{global}{verbose});
|
return if($loglevel > $attr{global}{verbose});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return if($ignoreRegexp && $text =~ m/^$ignoreRegexp$/);
|
||||||
|
|
||||||
my ($seconds, $microseconds) = gettimeofday();
|
my ($seconds, $microseconds) = gettimeofday();
|
||||||
my @t = localtime($seconds);
|
my @t = localtime($seconds);
|
||||||
@ -2752,6 +2755,7 @@ GlobalAttr($$$$)
|
|||||||
return "The global attribute $name cannot be deleted" if($noDel{$name});
|
return "The global attribute $name cannot be deleted" if($noDel{$name});
|
||||||
$featurelevel = 5.9 if($name eq "featurelevel");
|
$featurelevel = 5.9 if($name eq "featurelevel");
|
||||||
$haveInet6 = 0 if($name eq "useInet6"); # IPv6
|
$haveInet6 = 0 if($name eq "useInet6"); # IPv6
|
||||||
|
$ignoreRegexp = 0 if($name eq "ignoreRegexp");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2846,6 +2850,11 @@ GlobalAttr($$$$)
|
|||||||
$haveInet6 = 0;
|
$haveInet6 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elsif($name eq "ignoreRegexp") {
|
||||||
|
eval { "Hallo" =~ m/^$val$/ };
|
||||||
|
return $@ if($@);
|
||||||
|
$ignoreRegexp = $val;
|
||||||
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user