mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fhem.pl: escape events (Forum #61552)
git-svn-id: https://svn.fhem.de/fhem/trunk@12680 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8d2b086ccd
commit
e09bd7c213
27
fhem/fhem.pl
27
fhem/fhem.pl
@ -813,6 +813,21 @@ GetLogLevel(@)
|
|||||||
return $df;
|
return $df;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
GetVerbose($)
|
||||||
|
{
|
||||||
|
my ($dev) = @_;
|
||||||
|
if(defined($dev) &&
|
||||||
|
defined($attr{$dev}) &&
|
||||||
|
defined (my $devlevel = $attr{$dev}{verbose})) {
|
||||||
|
return $devlevel;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return $attr{global}{verbose};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
# the new Log with integrated loglevel checking
|
# the new Log with integrated loglevel checking
|
||||||
@ -2921,7 +2936,8 @@ stacktrace()
|
|||||||
my $max_depth = 50;
|
my $max_depth = 50;
|
||||||
|
|
||||||
# Forum #59831
|
# Forum #59831
|
||||||
Log 1, "eval: $cmdFromAnalyze" if($cmdFromAnalyze && $attr{global}{verbose} < 3);
|
Log 1, "eval: $cmdFromAnalyze"
|
||||||
|
if($cmdFromAnalyze && $attr{global}{verbose} < 3);
|
||||||
Log 1, "stacktrace:";
|
Log 1, "stacktrace:";
|
||||||
while( (my @call_details = (caller($i++))) && ($i<$max_depth) ) {
|
while( (my @call_details = (caller($i++))) && ($i<$max_depth) ) {
|
||||||
Log 1, sprintf (" %-35s called by %s (%s)",
|
Log 1, sprintf (" %-35s called by %s (%s)",
|
||||||
@ -3177,7 +3193,10 @@ DoTrigger($$@)
|
|||||||
# the inner loop.
|
# the inner loop.
|
||||||
if($max && !defined($hash->{INTRIGGER})) {
|
if($max && !defined($hash->{INTRIGGER})) {
|
||||||
$hash->{INTRIGGER}=1;
|
$hash->{INTRIGGER}=1;
|
||||||
Log 5, "Starting notify loop for $dev, first event $hash->{CHANGED}->[0]";
|
if($attr{global}{verbose} >= 5) {
|
||||||
|
Log 5, "Starting notify loop for $dev, " . scalar(@{$hash->{CHANGED}}) .
|
||||||
|
" event(s), first is " . escapeLogLine($hash->{CHANGED}->[0]);
|
||||||
|
}
|
||||||
createNtfyHash() if(!%ntfyHash);
|
createNtfyHash() if(!%ntfyHash);
|
||||||
$hash->{NTFY_TRIGGERTIME} = $now; # Optimize FileLog
|
$hash->{NTFY_TRIGGERTIME} = $now; # Optimize FileLog
|
||||||
my $ntfyLst = (defined($ntfyHash{$dev}) ? $ntfyHash{$dev} : $ntfyHash{"*"});
|
my $ntfyLst = (defined($ntfyHash{$dev}) ? $ntfyHash{$dev} : $ntfyHash{"*"});
|
||||||
@ -3405,7 +3424,9 @@ Dispatch($$$)
|
|||||||
my $module = $modules{$hash->{TYPE}};
|
my $module = $modules{$hash->{TYPE}};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
Log3 $hash, 5, "$name dispatch $dmsg";
|
if(GetVerbose($name) == 5) {
|
||||||
|
Log3 $hash, 5, escapeLogLine("$name: dispatch $dmsg");
|
||||||
|
}
|
||||||
|
|
||||||
my ($isdup, $idx) = CheckDuplicate($name, $dmsg, $module->{FingerprintFn});
|
my ($isdup, $idx) = CheckDuplicate($name, $dmsg, $module->{FingerprintFn});
|
||||||
return rejectDuplicate($name,$idx,$addvals) if($isdup);
|
return rejectDuplicate($name,$idx,$addvals) if($isdup);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user