2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-25 03:39:21 +00:00

fhem.pl: Add more info to the WARN sub.

git-svn-id: https://svn.fhem.de/fhem/trunk@6707 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-10-08 08:30:15 +00:00
parent 2d2671c499
commit 4c47844ad9

View File

@ -213,6 +213,7 @@ use vars qw(%readyfnlist); # devices which want a "readyfn"
use vars qw(%selectlist); # devices which want a "select"
use vars qw(%value); # Current values, see commandref.html
use vars qw($lastDefChange); # number of last def/attr change
use vars qw($cmdFromAnalyze); # used by the warnings-sub
my $AttrList = "verbose:0,1,2,3,4,5 room group comment alias ".
"eventMap userReadings";
@ -891,8 +892,10 @@ AnalyzePerlCommand($$)
$evalSpecials = undef;
}
$cmdFromAnalyze = $cmd;
my $ret = eval $cmd;
$ret = $@ if($@);
$cmdFromAnalyze = undef;
return $ret;
}
@ -2597,6 +2600,7 @@ SignalHandling()
$inWarnSub = 1;
chomp($msg);
Log 1, "PERL WARNING: $msg";
Log 3, "eval: $cmdFromAnalyze" if($cmdFromAnalyze && $msg =~ m/\(eval /);
stacktrace() if($attr{global}{verbose} >= 3 && $msg !~ m/ redefined at /);
$inWarnSub = 0;
};